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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200301052219.GA83612@google.com>
Date:   Sun, 1 Mar 2020 14:22:19 +0900
From:   Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        "Theodore Y. Ts'o" <tytso@....edu>, Petr Mladek <pmladek@...e.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Lech Perczak <l.perczak@...lintechnologies.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Arnd Bergmann <arnd@...db.de>,
        Krzysztof DrobiƄski 
        <k.drobinski@...lintechnologies.com>,
        Pawel Lenkow <p.lenkow@...lintechnologies.com>,
        John Ogness <john.ogness@...utronix.de>,
        Tejun Heo <tj@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: Regression in v4.19.106 breaking waking up of readers of
 /proc/kmsg and /dev/kmsg

On (20/02/29 18:47), Steven Rostedt wrote:
[..]
> > > What do folks think?  
> > 
> > Well, my 5 cents, there is nothing that prevents "too-early"
> > printk_deferred() calls in the future. From that POV I'd probably
> > prefer to "forbid" printk_deffered() to touch per-CPU deferred
> > machinery until it's not "too early" anymore. Similar to what we
> > do in printk_safe::queue_flush_work().
> 
> I agree that printk_deferred() should handle being called too early.
> But the issue is with per_cpu variables correct? Not the irq_work?

Correct. printk_deferred() and printk_safe()/printk_nmi() irq_works
are per-CPU. We use "a special" flag in printk_safe()/printk_nmi() to
tell if it's too early to modify per-CPU irq_work or not.

I believe that we need to use that flag for all printk-safe/nmi
per-CPU data, including buffers, not only for irq_work. Just in
case if printk_safe or printk_nmi, somehow, are being called too
early.

> We could add a flag in init/main.c after setup_per_cpu_areas() and then
> just have printk_deferred() act like a normal printk(). At that point,
> there shouldn't be an issue in calling printk() directly, is there?

Sure, this will work. I believe we introduced a "work around" approach
in printk-safe because noone would ACK a global init/main.c flag for
printk(). If we can land a "per_cpu_areas_ready" flag (I've some doubts
here), then yes (!), let's use it and let's remove printk-safe workaround.

	-ss

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ