Re: Worth using personality(ADDR_NO_RANDOMIZE) for EXEC_BACKEND on linux?
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, Andrew Dunstan <andrew@dunslane.net>,
PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2021-08-10T23:59:02Z
Lists: pgsql-hackers
On Wed, Aug 11, 2021 at 7:07 AM Thomas Munro <thomas.munro@gmail.com> wrote: > On Wed, Aug 11, 2021 at 2:12 AM Andres Freund <andres@anarazel.de> wrote: > > On Tue, Aug 10, 2021, at 15:19, Thomas Munro wrote: > > > Yeah, make check always fails for me on macOS 11. With the attached > > > experimental hack, it fails only occasionally (1 in 8 runs or so). I > > > don't know why. > > > > I suspect you'd need to use the hack in pg_ctl to make it reliable. The layout of normally stayed position independent postmaster can be incompatible with the non ASLR spawned child. > > Yeah, but the patch already changes both pg_ctl.c and postmaster.c. /me stares at vmmap output for a while Oooh. It's working perfectly (for example if you export PATH=binarys:$PATH, pg_ctl -D pgdata start, make installcheck), but pg_regress.c has its own separate fork/exec to launch the temporary cluster that needs to be similarly hacked. Unfortunately I have to give this Macintosh back and go and do some real work on a different computer now. That does seem to be a working solution to the problem, though, and could be polished into proposable form. I saw claims that you can also link with -Wl,-no_pie or toggle the PIE bit on your executable and libraries, but that didn't work for me on 11, Intel (no effect) or ARM (linker option gone).
Commits
-
Make EXEC_BACKEND more convenient on Linux and FreeBSD.
- 6b4dba711a4e 12.15 landed
- 1e4fda6da918 13.11 landed
- 0801345758db 14.8 landed
- f3e78069db7f 15.0 landed
-
Make EXEC_BACKEND more convenient on macOS.
- 8201b60565b8 14.0 landed
- 2c6275423535 13.5 landed
- a8096e30f4d0 12.9 landed
- 0bfefb7dafe0 11.14 landed
- d49e228a664d 10.19 landed
- 715a8668a5f7 9.6.24 landed
- 88cbbbfa3e2b 15.0 landed