[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1512685676-21933-4-git-send-email-me@tobin.cc>
Date: Fri, 8 Dec 2017 09:27:56 +1100
From: "Tobin C. Harding" <me@...in.cc>
To: Jonathan Corbet <corbet@....net>
Cc: "Tobin C. Harding" <me@...in.cc>,
Randy Dunlap <rdunlap@...radead.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
Kees Cook <keescook@...omium.org>,
Alexander Popov <alex.popov@...ux.com>,
kernel-hardening@...ts.openwall.com
Subject: [PATCH 3/3] 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@...in.cc>
Acked-by: Kees Cook <keescook@...omium.org>
---
Documentation/security/self-protection.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/security/self-protection.rst b/Documentation/security/self-protection.rst
index 60c8bd8b77bf..392b5660337e 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
addresses and kernel memory contents (since they may contain kernel
addresses or other sensitive things like canary values).
+Kernel addresses
+----------------
+
+Printing kernel addresses to userspace leaks sensitive information about
+the kernel memory layout. Care should be exercised when using any printk
+specifier that prints the raw address, currently %px, %p[ad], (and %p[sSb]
+in certain circumstances [*]). Any file written to using one of these
+specifiers should be readable only by privileged processes.
+
+Kernels 4.14 and older printed the raw address using %p. As of 4.15-rc1
+addresses printed with the specifier %p are hashed before printing.
+
+[*] If KALLSYMS is enabled and symbol lookup fails, the raw address is
+currently printed. If KALLSYMS is not enabled the address is printed.
+
Unique identifiers
------------------
--
2.7.4
Powered by blists - more mailing lists