[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <494BE687.2040700@ct.jp.nec.com>
Date: Fri, 19 Dec 2008 10:23:03 -0800
From: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: Toshikazu Nakayama <nakayama.ts@...s.nec.co.jp>,
linux-kernel@...r.kernel.org
Subject: [PATCH] printk: fix discarding message when recursion_bug
From: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
Impact: fix
When recursion_bug is true, kernel discards original message because printk_buf
contains recursion_bug_msg with NULL terminator. The sizeof(recursion_bug_msg)
makes this, use strlen() to get correct length without NULL terminator.
Reported-by: Toshikazu Nakayama <nakayama.ts@...s.nec.co.jp>
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@...jp.nec.com>
---
kernel/printk.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/printk.c b/kernel/printk.c
index f492f15..e651ab0 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -662,7 +662,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
if (recursion_bug) {
recursion_bug = 0;
strcpy(printk_buf, recursion_bug_msg);
- printed_len = sizeof(recursion_bug_msg);
+ printed_len = strlen(recursion_bug_msg);
}
/* Emit the output into the temporary buffer */
printed_len += vscnprintf(printk_buf + printed_len,
--
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists