On Tue, Aug 23, 2022 at 2:42 PM Thomas Munro <thomas.munro@xxxxxxxxx> wrote: > > 0002 isn't quite related, but while writing 0001 I noticed a nearby > > use of /proc/sys/... which I thought should be converted to sysctl. > > IMO /proc/sys pretty much sucks, at least for documentation purposes, > > for multiple reasons: Oh, one comment there is actually obsolete now AFAIK. Unless there is some reason to think personality(ADDR_NO_RANDOMIZE) might not work in some case where sysctl -w kernel.randomize_va_space=0 will, I think we can just remove that.
From 68e05cb3e4ae3b064af38241ac4ba8f9fe997b39 Mon Sep 17 00:00:00 2001 From: Thomas Munro <thomas.munro@xxxxxxxxx> Date: Wed, 24 Aug 2022 14:46:11 +1200 Subject: [PATCH] Remove obsolete comment. Since commit f3e78069db7, it shouldn't be necessary to use sysctl to disable ASLR on Linux. Remove comment about that. diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 1664fcee2a..51748ec735 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -4887,16 +4887,6 @@ SubPostmasterMain(int argc, char *argv[]) * to do this before going any further to ensure that we can attach at the * same address the postmaster used. On the other hand, if we choose not * to re-attach, we may have other cleanup to do. - * - * If testing EXEC_BACKEND on Linux, you should run this as root before - * starting the postmaster: - * - * sysctl -w kernel.randomize_va_space=0 - * - * This prevents using randomized stack and code addresses that cause the - * child process's memory map to be different from the parent's, making it - * sometimes impossible to attach to shared memory at the desired address. - * Return the setting to its old value (usually '1' or '2') when finished. */ if (strcmp(argv[1], "--forkbackend") == 0 || strcmp(argv[1], "--forkavlauncher") == 0 || -- 2.37.1