From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757662AbdLQWaw (ORCPT ); Sun, 17 Dec 2017 17:30:52 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:37195 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757641AbdLQWaq (ORCPT ); Sun, 17 Dec 2017 17:30:46 -0500 X-ME-Sender: From: "Tobin C. Harding" To: Jonathan Corbet Cc: "Tobin C. Harding" , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Alexander Popov , kernel-hardening@lists.openwall.com Subject: [PATCH v2 3/3] doc: add documentation on printing kernel addresses Date: Mon, 18 Dec 2017 09:30:07 +1100 Message-Id: <1513549807-20287-4-git-send-email-me@tobin.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513549807-20287-1-git-send-email-me@tobin.cc> References: <1513549807-20287-1-git-send-email-me@tobin.cc> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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..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 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 +printed. If KALLSYMS is not enabled the raw address is printed. + Unique identifiers ------------------ -- 2.7.4