From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C353A3839C5C; Wed, 11 May 2022 08:12:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C353A3839C5C From: "ptr@void-ptr.info" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: general X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ptr@void-ptr.info X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2022 08:12:56 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29141 Bug ID: 29141 Summary: _FORTIFY_SOURCE=3D3 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=3D3 fail to compile with gcc 12/glibc 2.35. Used: (GCC) 12.0.1 20220504 (prerelease) glibc ec5b79aac768 (release/2.35/master) 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 =E2=80=98pread=E2=80=99, inlined from =E2=80=98pread_retry=E2=80=99 at ../lib/system.h:188:21, inlined from =E2=80=98read_number_entries=E2=80=99 at elf_getarsym.c:63= :21, inlined from =E2=80=98elf_getarsym=E2=80=99 at elf_getarsym.c:172:11: ..../x86_64-unknown-linux-gnu/usr/include/bits/unistd.h:74:10: error: =E2=80=98__pread_alias=E2=80=99 specified size between 9223372036854775813 = and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=3Dstringop-overflow=3D] 74 | return __glibc_fortify (pread, __nbytes, sizeof (char), | ^~~~~~~~~~~~~~~ elf_getarsym.c: In function =E2=80=98elf_getarsym=E2=80=99: 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 c= all to function =E2=80=98__pread_alias=E2=80=99 declared with attribute =E2=80= =98access (write_only, 2, 3)=E2=80=99 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 =E2=80=98pread=E2=80=99, inlined from =E2=80=98pread_retry=E2=80=99 at ../lib/system.h:188:21, inlined from =E2=80=98read_number_entries=E2=80=99 at elf_getarsym.c:63= :21, inlined from =E2=80=98elf_getarsym=E2=80=99 at elf_getarsym.c:172:11: .../x86_64-unknown-linux-gnu/usr/include/bits/unistd.h:74:10: error: =E2=80=98__pread_alias=E2=80=99 specified size between 9223372036854775813 = and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=3Dstringop-overflow=3D] 74 | return __glibc_fortify (pread, __nbytes, sizeof (char), | ^~~~~~~~~~~~~~~ elf_getarsym.c: In function =E2=80=98elf_getarsym=E2=80=99: 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 ca= ll to function =E2=80=98__pread_alias=E2=80=99 declared with attribute =E2=80= =98access (write_only, 2, 3)=E2=80=99 50 | extern ssize_t __REDIRECT (__pread_alias, Lower level (_FORTIFY_SOURCE=3D2) compiled fine. Tricks similar to suggested in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91397 not help: warning disappear only when I set wrong condition if (w >=3D sizeof(u)) __builtin_unreachable(); (should be w > sizeof(u)). -- - ptr --=20 You are receiving this mail because: You are on the CC list for the bug.=