From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id CC6ED3854822; Thu, 3 Aug 2023 11:51:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC6ED3854822 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] arm: sanitizer stringop-overflow X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: ebfd369c3e9c18318c46d4ddc3ad016905d975ea X-Git-Newrev: b43e801e28550653ecef2b7e6b15125516ab1a58 Message-Id: <20230803115143.CC6ED3854822@sourceware.org> Date: Thu, 3 Aug 2023 11:51:43 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2023 11:51:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db43e801e2855= 0653ecef2b7e6b15125516ab1a58 commit b43e801e28550653ecef2b7e6b15125516ab1a58 Author: Alan Modra Date: Thu Aug 3 09:00:05 2023 +0930 arm: sanitizer stringop-overflow =20 In function 'memset', inlined from 'create_unwind_entry' at /home/alan/src/binutils-gdb/g= as/config/tc-arm.c:27881:3: /usr/include/bits/string_fortified.h:59:10: error: '__builtin_memset' s= pecified size between 2147483652 and 4294967295 exceeds maximum object size= 2147483647 [-Werror=3Dstringop-overflow=3D] 59 | return __builtin___memset_chk (__dest, __ch, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 | __glibc_objsize0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 * config/tc-arm.c (create_unwind_entry): Return after bad size, and bad opcode count. Diff: --- gas/config/tc-arm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index c0f6215fbc1..f912fb234b6 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -27828,7 +27828,10 @@ create_unwind_entry (int have_data) if (unwind.personality_index =3D=3D 0) { if (unwind.opcode_count > 3) - as_bad (_("too many unwind opcodes for personality routine 0")); + { + as_bad (_("too many unwind opcodes for personality routine 0")); + return 1; + } =20 if (!have_data) { @@ -27869,7 +27872,10 @@ create_unwind_entry (int have_data) =20 size =3D (size + 3) >> 2; if (size > 0xff) - as_bad (_("too many unwind opcodes")); + { + as_bad (_("too many unwind opcodes")); + return 1; + } =20 frag_align (2, 0, 0); record_alignment (now_seg, 2);