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]
Date:	Wed, 26 Mar 2014 12:34:21 -0400
From:	Josh Boyer <jwboyer@...oraproject.org>
To:	Prarit Bhargava <prarit@...hat.com>
Cc:	"Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
	Rob Landley <rob@...dley.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	linux-doc@...r.kernel.org
Subject: Re: [PATCH] Add initcall_blacklist kernel parameter

On Wed, Mar 26, 2014 at 10:00 AM, Prarit Bhargava <prarit@...hat.com> wrote:
> When a module is built into the kernel, the modules's module_init()
> function becomes an initcall.  Debugging built in kernel modules is
> typically done by changing the .config, recompiling, and booting the new
> kernel in an effort to determine exactly which module caused a problem.
> This is a wasteful time consuming process as it may be repeated several times
> before determining precisely what caused the problem.
>
> This patch has been useful in identifying problems with built-in modules and
> initcalls.  It allows a user to skip an initcall to see if the kernel
> would continue to boot properly without requiring recompiles.
>
> Usage: initcall_blacklist=<initcall function>
>
> ex) added "initcall_blacklist=sgi_uv_sysfs_init" as a kernel parameter and
> the log contains:
>
>         blacklisted initcall sgi_uv_sysfs_init
>         ...
>         ...
>         function sgi_uv_sysfs_init returning without executing
>

Could you elaborate on cases where this would be more useful than
initcall_debug?  It seems odd to have one option to debug initicalls
already saying it's useful for working out where the kernel is dying
during startup, and then adding another option with the same goal.

> Cc: Rob Landley <rob@...dley.net>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: linux-doc@...r.kernel.org
> Signed-off-by: Prarit Bhargava <prarit@...hat.com>
> ---
>  Documentation/kernel-parameters.txt |    4 ++++
>  init/main.c                         |   16 ++++++++++++++++
>  2 files changed, 20 insertions(+)
>
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 7116fda..dadc43b 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1268,6 +1268,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>                         for working out where the kernel is dying during
>                         startup.
>
> +       initcall_blacklist=  [KNL] Stop executing the specified initcall
> +                       function.  Useful for debugging built-in modules and
> +                       initcalls.
> +
>         initrd=         [BOOT] Specify the location of the initial ramdisk
>
>         inport.irq=     [HW] Inport (ATI XL and Microsoft) busmouse driver
> diff --git a/init/main.c b/init/main.c
> index 9c7fd4c..a34677c 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -666,6 +666,15 @@ static void __init do_ctors(void)
>  bool initcall_debug;
>  core_param(initcall_debug, initcall_debug, bool, 0644);
>
> +static char blacklist_buf[128] = "\0";
> +static int initcall_blacklist(char *str)
> +{
> +       snprintf(blacklist_buf, 127, "%s", str);
> +       pr_debug("blacklisted initcall %s\n", blacklist_buf);
> +       return 0;
> +}
> +__setup("initcall_blacklist=", initcall_blacklist);
> +

I'm not trying to bikeshed, but this isn't so much a list as it is a
single initcall to skip.  Maybe call it initcall_skip ?  I can see
people doing something like
initcall_blacklist=sgi_uv_sysfs_init,foo_bar_init,baz_debug_init and
being confused when nothing is skipped because no single initcall
matches that literal string.

josh
--
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