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:	Thu, 30 Jul 2015 05:10:46 -0700
From:	Joe Perches <joe@...ches.com>
To:	Petr Mladek <pmladek@...e.com>
Cc:	akpm@...ux-foundation.org, Tejun Heo <tj@...nel.org>,
	davem@...emloft.net, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org
Subject: Re: [PATCH] printk: Warn about dropped messages also on extended
 consoles

On Thu, 2015-07-30 at 13:28 +0200, Petr Mladek wrote:
> The commit #6fe29354befe4c ("printk: implement support for extended console
> drivers") added an extra buffer to format messages for extended consoles.
> We need to put there also the warning about dropped messages, so it appears
> on these consoles.
[]
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
[]
> @@ -2254,8 +2254,15 @@ again:
>  		}
>  
>  		if (console_seq < log_first_seq) {
> -			len = sprintf(text, "** %u printk messages dropped ** ",
> -				      (unsigned)(log_first_seq - console_seq));
> +			static const char dropped_msg[] =
> +				"** %u printk messages dropped ** ";

I don't see any value in dropped_msg as a
const char array instead of just using it directly
as a format in sprintf.  The linker will still use
a single format string in any case.

memcpy might be faster.

	if (nr_ext_console_drivers)
		memcpy(ext_text, text, len + 1);

> +			unsigned int dropped_count =
> +				(unsigned int)(log_first_seq - console_seq);
> +
> +			len = sprintf(text, dropped_msg, dropped_count);
> +			if (nr_ext_console_drivers)
> +				ext_len = sprintf(ext_text, dropped_msg,
> +						  dropped_count);
>  


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