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: <87a8phgw83.fsf@rustcorp.com.au>
Date:	Fri, 11 Dec 2015 20:09:40 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Laura Abbott <labbott@...oraproject.org>
Cc:	Laura Abbott <labbott@...oraproject.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH] module: Limit line length of module prints

Laura Abbott <labbott@...oraproject.org> writes:
> print_modules currently uses pr_cont to print all module information.
> This has the side effect of printing lots of modules on one very long
> line. This makes copy/pasting oopses more effort if manual wrapping is
> required. Place a reasonable limit (80 chars) on the number of modules
> on each line.
>
> Signed-off-by: Laura Abbott <labbott@...oraproject.org>
> ---
> Does this bother anyone else or am I the only one who hates dealing
> with the long lines of "Modules linked in"?

Never bothered me, but I'm a bit odd :)  I worry more about the effect
on machine parsing.

Cheers,
Rusty.

> ---
>  kernel/module.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 8f051a1..ace82f1 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -4059,11 +4059,14 @@ struct module *__module_text_address(unsigned long addr)
>  }
>  EXPORT_SYMBOL_GPL(__module_text_address);
>  
> +#define MAX_LINE_CHARS	80
> +
>  /* Don't grab lock, we're oopsing. */
>  void print_modules(void)
>  {
>  	struct module *mod;
>  	char buf[8];
> +	int cnt = 0;
>  
>  	printk(KERN_DEFAULT "Modules linked in:");
>  	/* Most callers should already have preempt disabled, but make sure */
> @@ -4071,7 +4074,13 @@ void print_modules(void)
>  	list_for_each_entry_rcu(mod, &modules, list) {
>  		if (mod->state == MODULE_STATE_UNFORMED)
>  			continue;
> -		pr_cont(" %s%s", mod->name, module_flags(mod, buf));
> +
> +		if (cnt > MAX_LINE_CHARS) {
> +			cnt = 0;
> +			pr_cont("\n");
> +		}
> +
> +		cnt += pr_cont(" %s%s", mod->name, module_flags(mod, buf));
>  	}
>  	preempt_enable();
>  	if (last_unloaded_module[0])
> -- 
> 2.5.0
--
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