All of lore.kernel.org
 help / color / mirror / Atom feed
* printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
@ 2020-04-14 12:06 Sergey Senozhatsky
  2020-04-14 12:14 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2020-04-14 12:06 UTC (permalink / raw)
  To: stable; +Cc: Petr Mladek

Hello,

Commit ab6f762f0f53162d41 Linus' HEAD.

printk_deferred() does not make sure that it's safe to write to
per-CPU data, which causes problems when printk_deferred() is
invoked "too early", before per-CPU areas are initialized. There
are multiple bug reports, e.g.
https://bugzilla.kernel.org/show_bug.cgi?id=206847

	-ss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
  2020-04-14 12:06 printk: queue wake_up_klogd irq_work only if per-CPU areas are ready Sergey Senozhatsky
@ 2020-04-14 12:14 ` Greg KH
  2020-04-14 13:13   ` Sergey Senozhatsky
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2020-04-14 12:14 UTC (permalink / raw)
  To: Sergey Senozhatsky; +Cc: stable, Petr Mladek

On Tue, Apr 14, 2020 at 09:06:13PM +0900, Sergey Senozhatsky wrote:
> Hello,
> 
> Commit ab6f762f0f53162d41 Linus' HEAD.
> 
> printk_deferred() does not make sure that it's safe to write to
> per-CPU data, which causes problems when printk_deferred() is
> invoked "too early", before per-CPU areas are initialized. There
> are multiple bug reports, e.g.
> https://bugzilla.kernel.org/show_bug.cgi?id=206847
> 
> 	-ss

So where do you want this commit backported to?

thanks,
greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
  2020-04-14 12:14 ` Greg KH
@ 2020-04-14 13:13   ` Sergey Senozhatsky
  2020-07-20 12:50     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Senozhatsky @ 2020-04-14 13:13 UTC (permalink / raw)
  To: Greg KH; +Cc: Sergey Senozhatsky, stable, Petr Mladek

On (20/04/14 14:14), Greg KH wrote:
> On Tue, Apr 14, 2020 at 09:06:13PM +0900, Sergey Senozhatsky wrote:
> > Hello,
> > 
> > Commit ab6f762f0f53162d41 Linus' HEAD.
> > 
> > printk_deferred() does not make sure that it's safe to write to
> > per-CPU data, which causes problems when printk_deferred() is
> > invoked "too early", before per-CPU areas are initialized. There
> > are multiple bug reports, e.g.
> > https://bugzilla.kernel.org/show_bug.cgi?id=206847
> > 
> > 	-ss
> 
> So where do you want this commit backported to?

Well,  printk() is affected in all the kernels where
printk_deferred() relies on per-CPU data. Which may
translate to "pretty much all current stable kernels?"
This patch, however, uses printk_safe() bits, so it
won't apply on pre-printk_safe() kernels (not sure if
we have such -stable kernels though).

	-ss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
  2020-04-14 13:13   ` Sergey Senozhatsky
@ 2020-07-20 12:50     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2020-07-20 12:50 UTC (permalink / raw)
  To: Sergey Senozhatsky; +Cc: stable, Petr Mladek

On Tue, Apr 14, 2020 at 10:13:09PM +0900, Sergey Senozhatsky wrote:
> On (20/04/14 14:14), Greg KH wrote:
> > On Tue, Apr 14, 2020 at 09:06:13PM +0900, Sergey Senozhatsky wrote:
> > > Hello,
> > > 
> > > Commit ab6f762f0f53162d41 Linus' HEAD.
> > > 
> > > printk_deferred() does not make sure that it's safe to write to
> > > per-CPU data, which causes problems when printk_deferred() is
> > > invoked "too early", before per-CPU areas are initialized. There
> > > are multiple bug reports, e.g.
> > > https://bugzilla.kernel.org/show_bug.cgi?id=206847
> > > 
> > > 	-ss
> > 
> > So where do you want this commit backported to?
> 
> Well,  printk() is affected in all the kernels where
> printk_deferred() relies on per-CPU data. Which may
> translate to "pretty much all current stable kernels?"
> This patch, however, uses printk_safe() bits, so it
> won't apply on pre-printk_safe() kernels (not sure if
> we have such -stable kernels though).

This is already in the 5.4.y tree, so I've added it to 4.19.y, but I
could not apply it to anything older (4.14.y, 4.9.y, 4.4.y) as it did
not apply there.

If you want it in those older kernels, and you think it is really
needed, please feel free to send a backported version for them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-20 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 12:06 printk: queue wake_up_klogd irq_work only if per-CPU areas are ready Sergey Senozhatsky
2020-04-14 12:14 ` Greg KH
2020-04-14 13:13   ` Sergey Senozhatsky
2020-07-20 12:50     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.