lib/test_printf.c: check for out-of-bound writes
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Sat, 16 Jan 2016 00:58:53 +0000 (16:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 16 Jan 2016 19:17:28 +0000 (11:17 -0800)
commit331e4deb6dfdac50d3f9c4ccbc41b1427335e212
tree3a755146ef906973c041b7c3db2697852e4749f3
parentfd0515d50ff33865d0f8cdd74510e8bd1aee88ac
lib/test_printf.c: check for out-of-bound writes

Add a few padding bytes on either side of the test buffer, and check
that these (and the part of the buffer not used) are untouched by
vsnprintf.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Joe Perches <joe@perches.com>
Cc: Maurizio Lombardi <mlombard@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/test_printf.c