Skip to content

Commit b7f5ab6

Browse files
schirmeierJiri Kosina
authored andcommitted
trivial: doc: document missing value 2 for randomize-va-space
The documentation for /proc/sys/kernel/* does not mention the possible value 2 for randomize-va-space yet. While being there, doing some reformatting, fixing grammar problems and clarifying the correlations between randomize-va-space, kernel parameter "norandmaps" and the CONFIG_COMPAT_BRK option. Signed-off-by: Horst Schirmeier <horst@schirmeier.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 627df23 commit b7f5ab6

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

‎Documentation/sysctl/kernel.txt‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -319,25 +319,29 @@ This option can be used to select the type of process address
319319
space randomization that is used in the system, for architectures
320320
that support this feature.
321321

322-
0 - Turn the process address space randomization off by default.
322+
0 - Turn the process address space randomization off. This is the
323+
default for architectures that do not support this feature anyways,
324+
and kernels that are booted with the "norandmaps" parameter.
323325

324326
1 - Make the addresses of mmap base, stack and VDSO page randomized.
325327
This, among other things, implies that shared libraries will be
326-
loaded to random addresses. Also for PIE-linked binaries, the location
327-
of code start is randomized.
328+
loaded to random addresses. Also for PIE-linked binaries, the
329+
location of code start is randomized. This is the default if the
330+
CONFIG_COMPAT_BRK option is enabled.
328331

329-
With heap randomization, the situation is a little bit more
330-
complicated.
331-
There a few legacy applications out there (such as some ancient
332+
2 - Additionally enable heap randomization. This is the default if
333+
CONFIG_COMPAT_BRK is disabled.
334+
335+
There are a few legacy applications out there (such as some ancient
332336
versions of libc.so.5 from 1996) that assume that brk area starts
333-
just after the end of the code+bss. These applications break when
334-
start of the brk area is randomized. There are however no known
337+
just after the end of the code+bss. These applications break when
338+
start of the brk area is randomized. There are however no known
335339
non-legacy applications that would be broken this way, so for most
336-
systems it is safe to choose full randomization. However there is
337-
a CONFIG_COMPAT_BRK option for systems with ancient and/or broken
338-
binaries, that makes heap non-randomized, but keeps all other
339-
parts of process address space randomized if randomize_va_space
340-
sysctl is turned on.
340+
systems it is safe to choose full randomization.
341+
342+
Systems with ancient and/or broken binaries should be configured
343+
with CONFIG_COMPAT_BRK enabled, which excludes the heap from process
344+
address space randomization.
341345

342346
==============================================================
343347

0 commit comments

Comments
 (0)