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: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Andres Freund <andres@anarazel.de>, Alvaro Herrera <alvherre@alvh.no-ip.org>,
Andrew Dunstan <andrew@dunslane.net>, PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2021-11-23T19:27:43Z
Lists: pgsql-hackers
Attachments
- 0001-Make-EXEC_BACKEND-work-reliably-on-Linux-and-FreeBSD.patch (text/x-patch) patch 0001
Here's a patch for Linux and also FreeBSD. The latter OS decided to turn on ASLR by default recently, causing my workstation to fail like this quite reliably, which reminded me to follow up with this. It disables ASLR in pg_ctl and pg_regress, which is enough for check and check-world, but doesn't help you if you run the server directly (unlike the different hack done for macOS). For whatever random reason the failures are rarer on Linux (could be my imagination, but I think they might be clustered, I didn't look into the recipe for the randomness), but even without reproducing a failure it's clear to see using pmap that this has the right effect. I didn't bother with a check for the existence of ADDR_NO_RANDOMIZE because it's since 2.6.12 which is definitely ancient enough.
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