[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWX0kvVP09Ttrb8Q+HTR3HDndEDVnS2aEHnRS4SHcc=Fw@mail.gmail.com>
Date: Thu, 2 May 2013 20:33:19 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: Re: [PATCH v2] init: Do not warn on non-zero initcall return
On Thu, May 2, 2013 at 5:17 PM, Steven Rostedt <rostedt@...dmis.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@...dmis.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.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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