lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bor9qtau.fsf@rustcorp.com.au>
Date:	Fri, 16 Dec 2011 10:30:41 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	jim.cromie@...il.com, jbaron@...hat.com
Cc:	greg@...ah.com, linux-kernel@...r.kernel.org,
	Jim Cromie <jim.cromie@...il.com>,
	Thomas Renninger <trenn@...e.de>
Subject: Re: [PATCH 18/25] dynamic_debug: Introduce global fake module param $module.dyndbg

On Mon, 12 Dec 2011 16:12:44 -0700, jim.cromie@...il.com wrote:
> From: Jim Cromie <jim.cromie@...il.com>
> 
> Rework Thomas Renninger's $module.ddebug boot-time debugging feature,
> from https://lkml.org/lkml/2010/9/15/397

OK, this looks cleaner!

> @@ -292,7 +292,8 @@ extern int parse_args(const char *name,
>  		      char *args,
>  		      const struct kernel_param *params,
>  		      unsigned num,
> -		      int (*unknown)(char *param, char *val));
> +		      int (*unknown)(char *param, char *val,
> +			      const char *modname));

s/modname/doing/ here, since it's a generic callback.

> -static int __init unknown_bootoption(char *param, char *val)
> +static int __init unknown_bootoption(char *param, char *val,
> +				const char *modname)
>  {

s/modname/doing/ (or /s/modname/unused/).

>  	/* Change NUL term back to "=", to make "param" the whole string. */
>  	if (val) {
> @@ -387,7 +388,7 @@ static noinline void __init_refok rest_init(void)
>  }
>  
>  /* Check for early params. */
> -static int __init do_early_param(char *param, char *val)
> +static int __init do_early_param(char *param, char *val, const char *modname)
>  {

Same as above.

> diff --git a/kernel/params.c b/kernel/params.c
> index 9240664..4c39c0e 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -86,9 +86,11 @@ bool parameq(const char *a, const char *b)
>  
>  static int parse_one(char *param,
>  		     char *val,
> +		     const char *doing,
>  		     const struct kernel_param *params,
>  		     unsigned num_params,
> -		     int (*handle_unknown)(char *param, char *val))
> +		     int (*handle_unknown)(char *param, char *val,
> +					   const char *modname))
>  {

s/modname/doing/ here too, makes it clear.

>  /* Args looks like "foo=bar,bar2 baz=fuz wiz". */
> -int parse_args(const char *name,
> +int parse_args(const char *doing, /* modname, Booting kernel, early options */
>  	       char *args,
>  	       const struct kernel_param *params,
>  	       unsigned num,
> -	       int (*unknown)(char *param, char *val))
> +	       int (*unknown)(char *param, char *val, const char *modname))
>  {

... again....

> +/* find & process .dyndbg params (prefixed by modname) in cmdline */
> +static __init void ddebug_boot_parse_args(void)
> +{

OK, I don't get why you are doing your own parsing for builtins?

Can't you call something from init/main.c:unknown_bootoption()?

If that's too early, I have a patch we're working on which adds
parameter parsing to each initlevel.

Thanks,
Rusty.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ