UBUNTU: SAUCE: (drop after 2.6.38) use %pK for /proc/kallsyms and /proc/modules
authorKees Cook <kees.cook@canonical.com>
Sat, 5 Feb 2011 07:13:58 +0000 (23:13 -0800)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:53:40 +0000 (06:53 -0700)
commit7ffd5b41b2feb3166b4c53a01a40c0288fa59554
tree1078f908579ae3300dc688ff25090702505b4b69
parente4fa17a839a38888008e46640641645e37304735
UBUNTU: SAUCE: (drop after 2.6.38) use %pK for /proc/kallsyms and /proc/modules

This should be in the 2.6.39 kernel from the -mm tree

In an effort to reduce kernel address leaks that might be used to
help target kernel privilege escalation exploits, this patch uses
%pK when displaying addresses in /proc/kallsyms, /proc/modules, and
/sys/module/*/sections/*.

Note that this changes %x to %p, so some legitimately 0 values in
/proc/kallsyms would have changed from 00000000 to "(null)". To avoid
this, "(null)" is not used when using the "K" format. Anything that was
already successfully parsing "(null)" in addition to full hex digits
should have no problem with this change. (Thanks to Joe Perches for
the suggestion.) Due to the %x to %p, "void *" casts are needed since
these addresses are already "unsigned long" everywhere internally, due
to their starting life as ELF section offsets.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Cc: Eugene Teo <eugene@redhat.com>
Cc: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
kernel/kallsyms.c
kernel/module.c
lib/vsprintf.c