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]
Date:	Mon, 23 Sep 2013 14:25:01 -0700
From:	Kees Cook <keescook@...omium.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Joe Perches <joe@...ches.com>, Tejun Heo <tj@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH RESEND] printk: report boot console names during cut-over

On Sat, Sep 21, 2013 at 4:52 PM, Frederic Weisbecker <fweisbec@...il.com> wrote:
> On Fri, Sep 20, 2013 at 08:34:01AM -0700, Kees Cook wrote:
>> This reports the names of boot consoles as they're being disabled to
>> help identify which is which during cut-over. Helps answer the question
>> "which boot console actually got activated?" once the regular console
>> is running, mostly when debugging boot console failures.
>>
>> Signed-off-by: Kees Cook <keescook@...omium.org>
>> ---
>>  kernel/printk/printk.c |   16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
>> index b4e8500..0dc54c9 100644
>> --- a/kernel/printk/printk.c
>> +++ b/kernel/printk/printk.c
>> @@ -2361,14 +2361,18 @@ void register_console(struct console *newcon)
>>       if (bcon &&
>>           ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) &&
>>           !keep_bootcon) {
>> -             /* we need to iterate through twice, to make sure we print
>> -              * everything out, before we unregister the console(s)
>> +             /* We need to iterate through all boot consoles, to make
>> +              * sure we print everything out, before we unregister them.
>>                */
>> -             printk(KERN_INFO "console [%s%d] enabled, bootconsole disabled\n",
>> -                     newcon->name, newcon->index);
>> -             for_each_console(bcon)
>> -                     if (bcon->flags & CON_BOOT)
>> +             for_each_console(bcon) {
>> +                     if (bcon->flags & CON_BOOT) {
>> +                             printk(KERN_INFO "console [%s%d] enabled, "
>> +                                     "bootconsole [%s%d] disabled\n",
>> +                                     newcon->name, newcon->index,
>> +                                     bcon->name, bcon->index);
>>                               unregister_console(bcon);
>
> Looks useful! But I think the "console %foo disabled" message should move to unregister_console()
> instead. That way it also handles printk_late_init() and all other console unregisters.

Yeah, that's a much cleaner way to do this. I'll send a new patch. Thanks!

-Kees

-- 
Kees Cook
Chrome OS Security
--
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