]> git.baikalelectronics.ru Git - kernel.git/commit
lib/vsprintf: Hash legacy clock addresses
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 11 Oct 2018 08:42:48 +0000 (10:42 +0200)
committerPetr Mladek <pmladek@suse.com>
Fri, 12 Oct 2018 09:24:41 +0000 (11:24 +0200)
commiteffd5c9f8af16a49f0a87b5dacf53f6ab4510d29
tree7c3bca08162b8d12fc2aa26557ded249c1f1ac4e
parent4b5f537df42bcaae5273f0a11e5b352c02e1c1b4
lib/vsprintf: Hash legacy clock addresses

On platforms using the Common Clock Framework, "%pC" prints the clock's
name. On legacy platforms, it prints the unhashed clock's address,
potentially leaking sensitive information regarding the kernel layout in
memory.

Avoid this leak by printing the hashed address instead.  To distinguish
between clocks, a 32-bit unique identifier is as good as an actual
pointer value.

Fixes: c50104c2c22fe576 ("printk: hash addresses printed with %p")
Link: http://lkml.kernel.org/r/20181011084249.4520-3-geert+renesas@glider.be
To: "Tobin C . Harding" <me@tobin.cc>
To: Andrew Morton <akpm@linux-foundation.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Documentation/core-api/printk-formats.rst
lib/vsprintf.c