public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] arm: sanitizer stringop-overflow
Date: Thu,  3 Aug 2023 11:51:43 +0000 (GMT)	[thread overview]
Message-ID: <20230803115143.CC6ED3854822@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b43e801e28550653ecef2b7e6b15125516ab1a58

commit b43e801e28550653ecef2b7e6b15125516ab1a58
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Aug 3 09:00:05 2023 +0930

    arm: sanitizer stringop-overflow
    
    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:
---
 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 == 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);

                 reply	other threads:[~2023-08-03 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230803115143.CC6ED3854822@sourceware.org \
    --to=amodra@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).