Annotation of /trunk/kernel-lts/patches-3.4/0132-3.4.33-all-fixes.patch
Parent Directory | Revision Log
Revision 2087 -
(hide annotations)
(download)
Tue Mar 5 09:00:39 2013 UTC (11 years, 6 months ago) by niro
File size: 1380 byte(s)
Tue Mar 5 09:00:39 2013 UTC (11 years, 6 months ago) by niro
File size: 1380 byte(s)
-linux-3.4.33
1 | niro | 2087 | diff --git a/include/linux/syslog.h b/include/linux/syslog.h |
2 | index 3891139..ce4c665 100644 | ||
3 | --- a/include/linux/syslog.h | ||
4 | +++ b/include/linux/syslog.h | ||
5 | @@ -47,6 +47,12 @@ | ||
6 | #define SYSLOG_FROM_CALL 0 | ||
7 | #define SYSLOG_FROM_FILE 1 | ||
8 | |||
9 | +/* | ||
10 | + * Syslog priority (PRI) maximum length in char : '<[0-9]{1,3}>' | ||
11 | + * See RFC5424 for details | ||
12 | +*/ | ||
13 | +#define SYSLOG_PRI_MAX_LENGTH 5 | ||
14 | + | ||
15 | int do_syslog(int type, char __user *buf, int count, bool from_file); | ||
16 | |||
17 | #endif /* _LINUX_SYSLOG_H */ | ||
18 | diff --git a/kernel/printk.c b/kernel/printk.c | ||
19 | index b663c2c..e95c662 100644 | ||
20 | --- a/kernel/printk.c | ||
21 | +++ b/kernel/printk.c | ||
22 | @@ -638,8 +638,19 @@ static void call_console_drivers(unsigned start, unsigned end) | ||
23 | start_print = start; | ||
24 | while (cur_index != end) { | ||
25 | if (msg_level < 0 && ((end - cur_index) > 2)) { | ||
26 | + /* | ||
27 | + * prepare buf_prefix, as a contiguous array, | ||
28 | + * to be processed by log_prefix function | ||
29 | + */ | ||
30 | + char buf_prefix[SYSLOG_PRI_MAX_LENGTH+1]; | ||
31 | + unsigned i; | ||
32 | + for (i = 0; i < ((end - cur_index)) && (i < SYSLOG_PRI_MAX_LENGTH); i++) { | ||
33 | + buf_prefix[i] = LOG_BUF(cur_index + i); | ||
34 | + } | ||
35 | + buf_prefix[i] = '\0'; /* force '\0' as last string character */ | ||
36 | + | ||
37 | /* strip log prefix */ | ||
38 | - cur_index += log_prefix(&LOG_BUF(cur_index), &msg_level, NULL); | ||
39 | + cur_index += log_prefix((const char *)&buf_prefix, &msg_level, NULL); | ||
40 | start_print = cur_index; | ||
41 | } | ||
42 | while (cur_index != end) { |