From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
To: Alexandre SIMON <Alexandre.Simon@univ-lorraine.fr>
Cc: Satoru Takeuchi <satoru.takeuchi@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [ 1/1] printk: fix buffer overflow when calling log_prefix function from call_console_drivers
Date: Thu, 21 Feb 2013 00:56:08 +0900 [thread overview]
Message-ID: <871ucbgesn.wl%satoru.takeuchi@gmail.com> (raw)
In-Reply-To: <5124D2ED.1090703@univ-lorraine.fr>
At Wed, 20 Feb 2013 14:43:09 +0100,
Alexandre SIMON wrote:
>
> [Satoru Takeuchi] wrote the following on [20/02/2013 14:02]:
> [...]
> >
> > I reviewed this patch and it seems to be good for me. Since I'm not good at
> > printk code, I want to confirm whether what I think is correct or not.
> > Is the following my understanding correct?
>
> No problem, it's nice to talk about this patch !
...
> > In this case, only LOG_BUF(cur_index) is safe to access and
> >
> > - "LOG_BUF(cur_index) + 1" as p[1],
> > - "LOG_BUF(cur_index) + 2" as p[2], and
> > - "LOG_BUF(cur_index) + 1 or more" as simple_strtoul(&p[1], &endp, 10)
> >
> > in log_prefix() are not to do so. Hence touching them would cause the system hang as you
> > said as follows.
>
> Yes, your analyze is totally right. Your figure is clear and shows exactly when the problem occurs in the "borderline case".
> The initial code does not check that the "cur_index" can be at the end of "log_buf" whereas "log_prefix" function may access to one, two or more indexes after.
Alex, thank you for quick response and the detailed explanation.
Greg, then I can say this patch looks correct and 3.0.66-rc1 version is too.
Thanks,
Satoru
next prev parent reply other threads:[~2013-02-20 15:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-18 18:24 [ 0/1] 3.4.33-stable review Greg Kroah-Hartman
2013-02-18 18:24 ` [ 1/1] printk: fix buffer overflow when calling log_prefix function from call_console_drivers Greg Kroah-Hartman
2013-02-20 13:02 ` Satoru Takeuchi
2013-02-20 13:43 ` Alexandre SIMON
2013-02-20 15:56 ` Satoru Takeuchi [this message]
2013-02-19 2:50 ` [ 0/1] 3.4.33-stable review Shuah Khan
2013-02-20 2:51 ` Greg Kroah-Hartman
2013-02-20 3:31 ` Shuah Khan
2013-02-20 13:09 ` Satoru Takeuchi
2013-02-18 18:25 [ 0/1] 3.0.66-stable review Greg Kroah-Hartman
2013-02-18 18:25 ` [ 1/1] printk: fix buffer overflow when calling log_prefix function from call_console_drivers Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ucbgesn.wl%satoru.takeuchi@gmail.com \
--to=satoru.takeuchi@gmail.com \
--cc=Alexandre.Simon@univ-lorraine.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).