printk: guard the amount written per line by devkmsg_read() 57/48457/3
authorTejun Heo <tj@kernel.org>
Thu, 14 May 2015 15:36:36 +0000 (11:36 -0400)
committerKazimierz Krosman <k.krosman@samsung.com>
Wed, 6 Apr 2016 11:07:11 +0000 (13:07 +0200)
commitfa0642c019674ad2f7de7ef7a0ffd4d0ea694133
tree97057dd1779dea09af45b8cbd024ba7291d6e966
parent20b72475649d721083777f7f679aaee2aee6e217
printk: guard the amount written per line by devkmsg_read()

devkmsg_read() uses 8k buffer and assumes that the formatted output
message won't overrun which seems safe given LOG_LINE_MAX, the current
use of dict and the escaping method being used; however, we're
planning to use devkmsg formatting wider and accounting for the buffer
size properly isn't that complicated.

This patch defines CONSOLE_EXT_LOG_MAX as 8192 and updates
devkmsg_read() so that it limits output accordingly.

Change-Id: Ic8579ddcd55294a38561e9e8b28449c067600db1
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Petr Mladek <pmladek@suse.cz>
include/linux/printk.h
kernel/printk/printk.c