From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7B08C3858416; Fri, 30 Jun 2023 17:43:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B08C3858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688146996; bh=kDxk0wRQcEKxPX7WwF8YkVQLpqtOT010x0pavVavyNc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fyNcOIMfJM/iRPUCpQ2af/78Zg44DVL3B3onYTD2lhuhua7eJGQVB5vhlUbEE/2yz rlXLZnKEkEbuhymweNt04ELIv5zspGDVSaBMvfIoOKA2HOD8fMAzDJvQ37wRgVsbUT DfDMDt7PcRtBTiRF4+LZ99Yy4lWw4Tmvr6uHPgT4= From: "cvs-commit at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/30452] LD_PREFER_MAP_32BIT_EXEC does not work with 2MiB load segment alignment Date: Fri, 30 Jun 2023 17:43:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.38 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30452 --- Comment #6 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by H.J. Lu : https://sourceware.org/git/gitweb.cgi?p=3Dglibc.git;h=3D6259ab39410cdefc800= 77afea48ca9cb057f6005 commit 6259ab39410cdefc80077afea48ca9cb057f6005 Author: H.J. Lu Date: Thu Jun 22 14:30:31 2023 -0700 ld.so: Always use MAP_COPY to map the first segment [BZ #30452] The first segment in a shared library may be read-only, not executable. To support LD_PREFER_MAP_32BIT_EXEC on such shared libraries, we also check MAP_DENYWRITE to decide if MAP_32BIT should be passed to mmap. Normally the first segment is mapped with MAP_COPY, which is defined as (MAP_PRIVATE | MAP_DENYWRITE). But if the segment alignment is greater than the page size, MAP_COPY isn't used to allocate enough space to ensure that the segment can be properly aligned. Map the first segment with MAP_COPY in this case to fix BZ #30452. --=20 You are receiving this mail because: You are on the CC list for the bug.=