Commit 26cc271db798cf211d35967cbfbb53e997126b84

Authored by Hiroshi Shimamoto
Committed by Ingo Molnar
1 parent 929096fe9f

printk: fix discarding message when recursion_bug

Impact: fix truncated recursion bug message printout

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@ncos.nec.co.jp>
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -662,7 +662,7 @@
662 662 if (recursion_bug) {
663 663 recursion_bug = 0;
664 664 strcpy(printk_buf, recursion_bug_msg);
665   - printed_len = sizeof(recursion_bug_msg);
  665 + printed_len = strlen(recursion_bug_msg);
666 666 }
667 667 /* Emit the output into the temporary buffer */
668 668 printed_len += vscnprintf(printk_buf + printed_len,