Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/xmon: avoid format string leaking to printk

This makes sure format strings cannot leak into printk (the string has
already been correctly processed for format arguments).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Kees Cook and committed by
Benjamin Herrenschmidt
50b66dbf 3752e453

+1 -1
+1 -1
arch/powerpc/xmon/nonstdio.c
··· 122 122 123 123 if (n && rc == 0) { 124 124 /* No udbg hooks, fallback to printk() - dangerous */ 125 - printk(xmon_outbuf); 125 + printk("%s", xmon_outbuf); 126 126 } 127 127 } 128 128