aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/security
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-12-19 16:17:17 -0500
committerJonathan Corbet <corbet@lwn.net>2017-12-21 15:39:27 -0500
commit227d1a61ed87033285d187214f305c27895176f9 (patch)
tree023f89073768511726dafaebb54dbeb28944dfde /Documentation/security
parentda271403a894f1139b3a49fca8fa19585902890e (diff)
doc: add documentation on printing kernel addresses
Hashing addresses printed with printk specifier %p was implemented recently. During development a number of issues were raised regarding leaking kernel addresses to userspace. Other documentation was updated but security/self-protection missed out. Add self-protection documentation regarding printing kernel addresses. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/security')
-rw-r--r--Documentation/security/self-protection.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/security/self-protection.rst b/Documentation/security/self-protection.rst
index 60c8bd8b77bf..0f53826c78b9 100644
--- a/Documentation/security/self-protection.rst
+++ b/Documentation/security/self-protection.rst
@@ -270,6 +270,21 @@ attacks, it is important to defend against exposure of both kernel memory
270addresses and kernel memory contents (since they may contain kernel 270addresses and kernel memory contents (since they may contain kernel
271addresses or other sensitive things like canary values). 271addresses or other sensitive things like canary values).
272 272
273Kernel addresses
274----------------
275
276Printing kernel addresses to userspace leaks sensitive information about
277the kernel memory layout. Care should be exercised when using any printk
278specifier that prints the raw address, currently %px, %p[ad], (and %p[sSb]
279in certain circumstances [*]). Any file written to using one of these
280specifiers should be readable only by privileged processes.
281
282Kernels 4.14 and older printed the raw address using %p. As of 4.15-rc1
283addresses printed with the specifier %p are hashed before printing.
284
285[*] If KALLSYMS is enabled and symbol lookup fails, the raw address is
286printed. If KALLSYMS is not enabled the raw address is printed.
287
273Unique identifiers 288Unique identifiers
274------------------ 289------------------
275 290