From: Nick Desaulniers <ndesaulni...@google.com>

Switch from 0x%lx to 0x%pK to print the kernel addresses.

Fixes: CVE-2017-0630
Signed-off-by: Mark Salyzyn <saly...@android.com>
Cc: Nick Desaulniers <ndesaulni...@google.com>
Cc: Steven Rostedt <rost...@goodmis.org>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: <kernel-t...@android.com>
Cc: <sta...@vger.kernel.org> # 3.18, 4.4, 4.9, 4.14
Cc: <linux-kernel@vger.kernel.org>

---
 kernel/trace/trace_printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
index ad1d6164e946..93698023baf1 100644
--- a/kernel/trace/trace_printk.c
+++ b/kernel/trace/trace_printk.c
@@ -304,7 +304,7 @@ static int t_show(struct seq_file *m, void *v)
        if (!*fmt)
                return 0;
 
-       seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt);
+       seq_printf(m, "0x%pK : \"", *(unsigned long *)fmt);
 
        /*
         * Tabs and new lines need to be converted.
-- 
2.18.0.233.g985f88cf7e-goog

Reply via email to