Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 47a86fa

Browse files
committed
Add code comment about Linux stack randomization and shared memory.
1 parent 802c7aa commit 47a86fa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/backend/postmaster/postmaster.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.480 2006/02/01 00:31:59 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.481 2006/02/01 16:00:06 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -3336,7 +3336,18 @@ SubPostmasterMain(int argc, char *argv[])
33363336
/* Need a PGPROC to run CreateSharedMemoryAndSemaphores */
33373337
InitProcess();
33383338

3339-
/* Attach process to shared data structures */
3339+
/*
3340+
* Attach process to shared data structures. If testing
3341+
* EXEC_BACKEND on Linux, you must run this as root
3342+
* before starting the postmaster:
3343+
*
3344+
* echo 0 >/proc/sys/kernel/randomize_va_space
3345+
*
3346+
* This prevents a randomized stack base address that causes
3347+
* child shared memory to be at a different address than
3348+
* the parent, making it impossible to attached to shared
3349+
* memory. Return the value to '1' when finished.
3350+
*/
33403351
CreateSharedMemoryAndSemaphores(false, 0);
33413352

33423353
/* And run the backend */

0 commit comments

Comments
 (0)