powerpc/xmon: avoid format string leaking to printk
authorKees Cook <keescook@chromium.org>
Tue, 10 Jun 2014 17:54:06 +0000 (10:54 -0700)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 11 Jun 2014 07:04:03 +0000 (17:04 +1000)
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>
arch/powerpc/xmon/nonstdio.c

index bce3dcf..c987486 100644 (file)
@@ -122,7 +122,7 @@ void xmon_printf(const char *format, ...)
 
        if (n && rc == 0) {
                /* No udbg hooks, fallback to printk() - dangerous */
-               printk(xmon_outbuf);
+               printk("%s", xmon_outbuf);
        }
 }