public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "ptr@void-ptr.info" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/29141] New: _FORTIFY_SOURCE=3 fail for gcc 12/glibc 2.35
Date: Wed, 11 May 2022 08:12:56 +0000	[thread overview]
Message-ID: <bug-29141-10460@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29141

            Bug ID: 29141
           Summary: _FORTIFY_SOURCE=3 fail for gcc 12/glibc 2.35
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: general
          Assignee: unassigned at sourceware dot org
          Reporter: ptr@void-ptr.info
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Hi,

_FORTIFY_SOURCE=3 fail to compile with gcc 12/glibc 2.35.

Used:
  (GCC) 12.0.1 20220504 (prerelease)
  glibc ec5b79aac768 (release/2.35/master)

<snip>
In file included from ..../x86_64-unknown-linux-gnu/usr/include/features.h:490,
                 from .../x86_64-unknown-linux-gnu/usr/include/assert.h:35,
                 from elf_getarsym.c:34:
In function ‘pread’,
    inlined from ‘pread_retry’ at ../lib/system.h:188:21,
    inlined from ‘read_number_entries’ at elf_getarsym.c:63:21,
    inlined from ‘elf_getarsym’ at elf_getarsym.c:172:11:
..../x86_64-unknown-linux-gnu/usr/include/bits/unistd.h:74:10: error:
‘__pread_alias’ specified size between 9223372036854775813 and
18446744073709551615 exceeds maximum object size 9223372036854775807
[-Werror=stringop-overflow=]
   74 |   return __glibc_fortify (pread, __nbytes, sizeof (char),
      |          ^~~~~~~~~~~~~~~
elf_getarsym.c: In function ‘elf_getarsym’:
elf_getarsym.c:56:5: note: destination object allocated here
   56 |   } u;
      |     ^
..../x86_64-unknown-linux-gnu/usr/include/bits/unistd.h:50:16: note: in a call
to function ‘__pread_alias’ declared with attribute ‘access (write_only, 2, 3)’
   50 | extern ssize_t __REDIRECT (__pread_alias,
      |                ^~~~~~~~~~


In file included from ..../x86_64-unknown-linux-gnu/usr/include/features.h:490,
                 from ..../x86_64-unknown-linux-gnu/usr/include/assert.h:35,
                 from elf_getarsym.c:34:
In function ‘pread’,
    inlined from ‘pread_retry’ at ../lib/system.h:188:21,
    inlined from ‘read_number_entries’ at elf_getarsym.c:63:21,
    inlined from ‘elf_getarsym’ at elf_getarsym.c:172:11:
.../x86_64-unknown-linux-gnu/usr/include/bits/unistd.h:74:10: error:
‘__pread_alias’ specified size between 9223372036854775813 and
18446744073709551615 exceeds maximum object size 9223372036854775807
[-Werror=stringop-overflow=]
   74 |   return __glibc_fortify (pread, __nbytes, sizeof (char),
      |          ^~~~~~~~~~~~~~~
elf_getarsym.c: In function ‘elf_getarsym’:
elf_getarsym.c:56:5: note: destination object allocated here
   56 |   } u;
      |     ^
.../x86_64-unknown-linux-gnu/usr/include/bits/unistd.h:50:16: note: in a call
to function ‘__pread_alias’ declared with attribute ‘access (write_only, 2, 3)’
   50 | extern ssize_t __REDIRECT (__pread_alias,
</snip>

Lower level (_FORTIFY_SOURCE=2) compiled fine.

Tricks similar to suggested in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91397
not help: warning disappear only when I set wrong condition

  if (w >= sizeof(u))
    __builtin_unreachable();

(should be w > sizeof(u)).

--

   - ptr

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-05-11  8:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11  8:12 ptr@void-ptr.info [this message]
2022-05-11 11:10 ` [Bug general/29141] " mark at klomp dot org
2022-05-11 16:04 ` siddhesh at sourceware dot org
2022-05-12 10:23 ` [Bug libc/29141] " siddhesh at sourceware dot org
2022-05-12 20:03 ` ptr@void-ptr.info
2022-05-13  3:44 ` ptr@void-ptr.info
2022-05-13  4:02 ` siddhesh at sourceware dot org
2022-05-16 14:41 ` cvs-commit at gcc dot gnu.org
2022-05-16 16:04 ` siddhesh at sourceware dot org
2022-05-16 16:24 ` cvs-commit at gcc dot gnu.org
2022-05-16 17:01 ` cvs-commit at gcc dot gnu.org

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=bug-29141-10460@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@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).