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: <20180911084722.22fqbewiebzsdofm@pathway.suse.cz>
Date:   Tue, 11 Sep 2018 10:47:22 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc:     Hans de Goede <hdegoede@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        Steven Rostedt <rostedt@...dmis.org>,
        Maninder Singh <maninder1.s@...sung.com>
Subject: Re: [PATCH 4.19 regression fix] printk: For early boot messages
 check loglevel when flushing the buffer

On Tue 2018-09-11 11:30:39, Sergey Senozhatsky wrote:
> On (09/10/18 16:57), Petr Mladek wrote:
> > 
> > Good catch.
> > 
> > > ---
> > > 
> > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > > index c036f128cdc3..ede29a7ba6db 100644
> > > --- a/kernel/printk/printk.c
> > > +++ b/kernel/printk/printk.c
> > > @@ -2545,6 +2545,7 @@ void console_flush_on_panic(void)
> > >  	 * ensure may_schedule is cleared.
> > >  	 */
> > >  	console_trylock();
> > > +	exclusive_console = NULL;
> > 
> > This is not be enough. It would cause replying old messages
> > on all consoles.
> 
> Oh, that was intentional. I consider repeated messages to be less
> problematic than the missing ones.

It makes some sense. But it might be problematic with slow consoles.
I prefer to avoid it if there is a better solution.


> > Most problems should probably be solved when we store console_seq
> > before setting exclusive_console. Then we could clear
> > exclusive_console when reaching the stored sequence number.
> > 
> > Can this be that simple? ;-)
> 
> This can work, yes.

I'll try to cook up a patch later this week.


> I also thought about doing it the way Linus, Jan Kara and Hannes
> Reinecke proposed:
> 
> - store the console_seq nr of the first oops_in_progress message
>   (oops_console_seq) and flush only messages that are in
>   [oops_console_seq - 200, log_next_seq] range, as opposed to complete
>   logbuf flush.
> 
> Hannes asked for this several times. And it was in Jan's printk patches
> long time ago (if I'm not mistaken - sorry if I am -- Jan said that Linus
> wanted that "just N messages prior to oops" thing).
> 
> Jan's patch:
>  https://lore.kernel.org/lkml/1457964820-4642-3-git-send-email-sergey.senozhatsky@gmail.com/T/#u

The patch might be useful but it also might be controversial. It would
deserve discussion with a wide audience in a dedicated thread.


> > This reverts commit 375899cddcbb26881b03cb3fbdcfd600e4e67f4a.
> > 
> > Reported-by: Hans de Goede <hdegoede@...hat.com>
> > Signed-off-by: Petr Mladek <pmladek@...e.com>
> 
> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>

I have just pushed the patch into printk.git, for-4.19-rc4 branch.

Note that I merged also a revert of the build fix
commit ffaa619af1b06 ("printk: Fix warning about unused
suppress_message_printing"). I am sorry that I missed
it in the original patch. It is an obvious oneliner.
It should not invalidate the acks.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ