lkml.org 
[lkml]   [2008]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] printk: fix discarding message when recursion_bug
    From: Hiroshi Shimamoto <h-shimamoto@ct.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@ncos.nec.co.jp>
    Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.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


    \
     
     \ /
      Last update: 2008-12-19 19:25    [W:0.019 / U:29.360 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site