public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* arm: sanitizer stringop-overflow
@ 2023-08-03 11:46 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-08-03 11:46 UTC (permalink / raw)
  To: binutils

In function ‘memset’,
    inlined from ‘create_unwind_entry’ at /home/alan/src/binutils-gdb/gas/config/tc-arm.c:27881:3:
/usr/include/bits/string_fortified.h:59:10: error: ‘__builtin_memset’ specified size between 2147483652 and 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~

	* config/tc-arm.c (create_unwind_entry): Return after bad size,
	and bad opcode count.

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 == 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;
+	    }
 
 	  if (!have_data)
 	    {
@@ -27869,7 +27872,10 @@ create_unwind_entry (int have_data)
 
   size = (size + 3) >> 2;
   if (size > 0xff)
-    as_bad (_("too many unwind opcodes"));
+    {
+      as_bad (_("too many unwind opcodes"));
+      return 1;
+    }
 
   frag_align (2, 0, 0);
   record_alignment (now_seg, 2);

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-03 11:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 11:46 arm: sanitizer stringop-overflow Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).