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] [day] [month] [year] [list]
Message-ID: <200907211437.04056.rgetz@blackfin.uclinux.org>
Date:	Tue, 21 Jul 2009 14:37:03 -0400
From:	Robin Getz <rgetz@...ckfin.uclinux.org>
To:	"Ingo Molnar" <mingo@...e.hu>
CC:	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Mike Frysinger" <vapier.adi@...il.com>,
	linux-kernel@...r.kernel.org,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	Sonic.Zhang@...log.com
Subject: Re: [PATCH] - printk handling more than one CON_BOOT

On Wed 1 Jul 2009 21:08, Robin Getz pondered:
>  printk.c |  146 +++++++++++++++++++++++++++++++++--------------------
>  1 file changed, 92 insertions(+), 54 deletions(-)
> 
> diff --git a/kernel/printk.c b/kernel/printk.c
> index b4d97b5..9acc262 100644
> --- a/kernel/printk.c
> +++ b/kernel/printk.c

[snip]

>  static int __init disable_boot_consoles(void)
>  {
> -	if (console_drivers != NULL) {
> -		if (console_drivers->flags & CON_BOOT) {
> +	struct console *con;
> +
> +	for_each_console(con) {
> +		if (con->flags & CON_BOOT) {
>  			printk(KERN_INFO "turn off boot console %s%d\n",
> -				console_drivers->name, console_drivers->index);
> -			return unregister_console(console_drivers);
> +				con->name, con->index);
> +			return unregister_console(con);
>  		}
>  	}
>  	return 0;

This causes a bug that Sonic found.

The below patch fixes it, and should be applied to tip.

---

From: Sonic Zhang <Sonic.Zhang@...log.com>

Don't return when we find the first bootconsole - it can leave other
bootconsoles still installed, and they can be used and cause problems later
(if they are in the init section, and eventually released), and cause
problems. Make sure we remove all of them.

Signed-off-by: Sonic Zhang <Sonic.Zhang@...log.com>
Signed-off-by: Robin Getz <rgetz@...log.com>

---

diff --git a/kernel/printk.c b/kernel/printk.c
index e0daaf5..e10d193 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1352,7 +1352,7 @@ static int __init disable_boot_consoles(void)
 		if (con->flags & CON_BOOT) {
 			printk(KERN_INFO "turn off boot console %s%d\n",
 				con->name, con->index);
-			return unregister_console(con);
+			unregister_console(con);
 		}
 	}
 	return 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