From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC89E386F022; Tue, 1 Dec 2020 11:46:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC89E386F022 From: "nsz at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/26988] New: aarch64: BTI mprotect address is not page aligned Date: Tue, 01 Dec 2020 11:46:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.32 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nsz at gcc dot gnu.org X-Bugzilla-Status: NEW 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 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: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2020 11:46:07 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26988 Bug ID: 26988 Summary: aarch64: BTI mprotect address is not page aligned Product: glibc Version: 2.32 Status: NEW Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: nsz at gcc dot gnu.org Target Milestone: --- bti enabled glibc does not handle elf binaries correctly that have an executable load segment with virtual address that is not page aligned. mprotect fails, which is currently treated as fatal error. i think the bfd linker does not produce such binaries, but lld does that by default, typical exe layout: Program Headers: Type Offset VirtAddr PhysAddr FileSiz Me= mSiz Flg Align PHDR 0x000040 0x0000000000200040 0x0000000000200040 0x0002d8 0x0002d8 R 0x8 INTERP 0x000318 0x0000000000200318 0x0000000000200318 0x00001b 0x00001b R 0x1 [Requesting program interpreter: /lib/ld-linux-aarch64.so.1] LOAD 0x000000 0x0000000000200000 0x0000000000200000 0x000704 0x000704 R 0x10000 LOAD 0x000710 0x0000000000210710 0x0000000000210710 0x000290 0x000290 R E 0x10000 LOAD 0x0009a0 0x00000000002209a0 0x00000000002209a0 0x0001c8 0x0001c8 RW 0x10000 LOAD 0x000b68 0x0000000000230b68 0x0000000000230b68 0x000048 0x000049 RW 0x10000 DYNAMIC 0x0009b0 0x00000000002209b0 0x00000000002209b0 0x0001b0 0x0001b0 RW 0x8 GNU_RELRO 0x0009a0 0x00000000002209a0 0x00000000002209a0 0x0001c8 0x000660 R 0x1 GNU_EH_FRAME 0x0005bc 0x00000000002005bc 0x00000000002005bc 0x000044 0x000044 R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0 GNU_PROPERTY 0x000358 0x0000000000200358 0x0000000000200358 0x000020 0x000020 R 0x8 NOTE 0x000334 0x0000000000200334 0x0000000000200334 0x000020 0x000020 R 0x4 NOTE 0x000358 0x0000000000200358 0x0000000000200358 0x000020 0x000020 R 0x8 (i.e. the readonly program headers and notes are not covered by the executable load segment and there is no page alignment either: with bfd linker either program headers are covered or executable segment has an alignment gap.) --=20 You are receiving this mail because: You are on the CC list for the bug.=