vsprintf: Limit the length of inlined error messages
authorPetr Mladek <pmladek@suse.com>
Wed, 17 Apr 2019 11:53:50 +0000 (13:53 +0200)
committerPetr Mladek <pmladek@suse.com>
Fri, 26 Apr 2019 14:21:22 +0000 (16:21 +0200)
commitc8c3b584343cb7522fc00322769a9f288305743f
tree4c0fb6e7eb3ddd39db25d45d0244cb1cc1632363
parent635720ac75a51092b456bed517ff170047883252
vsprintf: Limit the length of inlined error messages

The inlined error messages must be used carefully because
they need to fit into the given buffer.

Handle them using a custom wrapper that makes people aware
of the problem. Also define a reasonable hard limit to
avoid a completely insane usage.

Suggested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Link: http://lkml.kernel.org/r/20190417115350.20479-11-pmladek@suse.com
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Tobin C . Harding" <me@tobin.cc>
Cc: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
lib/vsprintf.c