mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v2] init: Do not warn on non-zero initcall return
Date: Thu, 02 May 2013 14:45:25 -0400	[thread overview]
Message-ID: <1367520325.7373.2.camel@gandalf.local.home> (raw)
In-Reply-To: <CAMuHMdWX0kvVP09Ttrb8Q+HTR3HDndEDVnS2aEHnRS4SHcc=Fw@mail.gmail.com>

On Thu, 2013-05-02 at 20:33 +0200, Geert Uytterhoeven wrote:
> On Thu, May 2, 2013 at 5:17 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > On Thu, 2013-05-02 at 09:43 +0200, Geert Uytterhoeven wrote:
> >> On Wed, May 1, 2013 at 7:35 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> >> > --- a/init/main.c
> >> > +++ b/init/main.c
> >> > @@ -686,11 +686,8 @@ int __init_or_module do_one_initcall(initcall_t fn)
> >> >
> >> >         msgbuf[0] = 0;
> >> >
> >> > -       if (ret && ret != -ENODEV && initcall_debug)
> >> > -               sprintf(msgbuf, "error code %d ", ret);
> >> > -
> >> >         if (preempt_count() != count) {
> >> > -               strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
> >> > +               sprintf(msgbuf, "preemption imbalance ");
> >>
> >> snprintf(), please?
> >
> > Why? The msgbuf is 64 bytes, this is the first occurrence and
> > "preemption imbalance " is much less than 64 bytes.
> 
> The day after tomorrow, someone will modify the code, and cause a buffer
> overflow.
> 
> I'm actually surprised (v)sprintf() is not tagged __deprecated.
> 

I actually did think for a second in adding that. Not sure why I didn't.
Probably just because the original code didn't do that.

But I'll let that clean up come another day by someone else.

-- Steve



      reply	other threads:[~2013-05-02 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 17:35 Steven Rostedt
2013-05-02  7:43 ` Geert Uytterhoeven
2013-05-02 15:17   ` Steven Rostedt
2013-05-02 18:33     ` Geert Uytterhoeven
2013-05-02 18:45       ` Steven Rostedt [this message]

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=1367520325.7373.2.camel@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®