lib/vsprintf.c: kptr_restrict: fix pK-error in SysRq show-all-timers(Q)
authorDan Rosenberg <drosenberg@vsecurity.com>
Mon, 30 Jul 2012 21:40:26 +0000 (14:40 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 9 Aug 2012 23:25:01 +0000 (00:25 +0100)
commit1b772a147a183c09462f0d23e041b077f158fa0f
treee6e1b445066c1399894f14e1481db4865a49d115
parentffb709e6aa95c3ba44fa8af9f7815e3c6cfed04e
lib/vsprintf.c: kptr_restrict: fix pK-error in SysRq show-all-timers(Q)

commit 3715c5309f6d175c3053672b73fd4f73be16fd07 upstream.

When using ALT+SysRq+Q all the pointers are replaced with "pK-error" like
this:

[23153.208033]   .base:               pK-error

with echo h > /proc/sysrq-trigger it works:

[23107.776363]   .base:       ffff88023e60d540

The intent behind this behavior was to return "pK-error" in cases where
the %pK format specifier was used in interrupt context, because the
CAP_SYSLOG check wouldn't be meaningful.  Clearly this should only apply
when kptr_restrict is actually enabled though.

Reported-by: Stevie Trujillo <stevie.trujillo@gmail.com>
Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
lib/vsprintf.c