summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-05-14 11:36:36 -0400
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:49:11 +0900
commita1c3d4a366a3c5f085a4d049682b170393f7bd9e (patch)
treeea1f624bfec4dbd566b0ae379a9d33fce5f0437b /include/linux
parent6a436d340c498403c1f8643571c091ac96727f60 (diff)
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/printk.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 9b30871c9149..58b1fec40d37 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -30,6 +30,8 @@ static inline const char *printk_skip_level(const char *buffer)
return buffer;
}
+#define CONSOLE_EXT_LOG_MAX 8192
+
/* printk's without a loglevel use this.. */
#define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT