mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pawel Moll <pawel.moll@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: re: params: <level>_initcall-like kernel parameters
Date: Thu, 02 Feb 2012 11:08:57 +0000	[thread overview]
Message-ID: <1328180937.1888.18.camel@hornet.cambridge.arm.com> (raw)
In-Reply-To: <20120202095612.GA30632@elgon.mountain>

Morning,

On Thu, 2012-02-02 at 09:56 +0000, Dan Carpenter wrote:
> The patch b41c2e271944: "params: <level>_initcall-like kernel 
> parameters" from Dec 12, 2011, leads to the following warning:
> init/main.c:749 do_initcall_level()
> 	 error: buffer overflow 'initcall_level_names' 7 <= 7
> 
>    743  static void __init do_initcall_level(int level)
>    744  {
>    745          extern const struct kernel_param __start___param[], __stop___param[];
>    746          initcall_t *fn;
>    747  
>    748          strcpy(static_command_line, saved_command_line);
>    749          parse_args(initcall_level_names[level],
>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> initcall_level_names[] has 7 elements so initcall_level_names[7] is past
> the end of the array.
> 
>    750                     static_command_line, __start___param,
>    751                     __stop___param - __start___param,
>    752                     level, level,
>    753                     ignore_unknown_bootoption);
>    754  
>    755          for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)
>    756                  do_one_initcall(*fn);
>    757  }
>    758  
>    759  static void __init do_initcalls(void)
>    760  {
>    761          int level;
>    762  
>    763          for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++)
>                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> initcall_levels[] has 9 elements so level is 0-7 here.
> 
>    764                  do_initcall_level(level);
>    765  }

You're right, of course! The initcall_level_names is missing "early
parameters" string as the first element of the array. Well spotted - may
I asked what tool did you use to get this message?

Rusty, do you want me to re-send the patch with this string fixed? I
think you have rebased it on top of your bool-param series?

Thanks for your time!

Paweł




  reply	other threads:[~2012-02-02 11:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02  9:56 Dan Carpenter
2012-02-02 11:08 ` Pawel Moll [this message]
2012-02-02 17:01   ` Dan Carpenter
2012-02-06 22:16   ` Rusty Russell
2012-02-07 14:45     ` [PATCH] params: Add missing init level name Pawel Moll

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=1328180937.1888.18.camel@hornet.cambridge.arm.com \
    --to=pawel.moll@arm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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®