]> git.baikalelectronics.ru Git - kernel.git/commit
vsprintf: don't use 'restricted_pointer()' when not restricting
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 29 Nov 2017 19:28:09 +0000 (11:28 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 29 Nov 2017 19:28:09 +0000 (11:28 -0800)
commita6c98e2f29bd1e7b2abd8e0545a114d6006cc910
tree8390d91f247b724dd00ad91f25d8bcf391e3a52c
parentf401dbc58020e96a8e935da4e92357dd10b3bdd0
vsprintf: don't use 'restricted_pointer()' when not restricting

Instead, just fall back on the new '%p' behavior which hashes the
pointer.

Otherwise, '%pK' - that was intended to mark a pointer as restricted -
just ends up leaking pointers that a normal '%p' wouldn't leak.  Which
just make the whole thing pointless.

I suspect we should actually get rid of '%pK' entirely, and make it just
work as '%p' regardless, but this is the minimal obvious fix.  People
who actually use 'kptr_restrict' should weigh in on which behavior they
want.

Cc: Tobin Harding <me@tobin.cc>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/vsprintf.c