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]
Date: Tue, 28 May 2024 06:40:03 +0000
From: xu xin <xu.xin.sc@...il.com>
To: xu.xin16@....com.cn
Cc: bigeasy@...utronix.de,
	john.ogness@...utronix.de,
	linux-kernel@...r.kernel.org,
	linux-rt-users@...r.kernel.org,
	liu.chun2@....com.cn,
	rostedt@...dmis.org,
	si.hao@....com.cn,
	yang.yang29@....com.cn,
	zhang.yunkai@....com.cn
Subject: Re: [PATCH  5.10-rt] printk: ignore that console preempted by irq/softirq

> > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> > index 7f27cfee283e..faab85dd4439 100644
> > --- a/kernel/printk/printk.c
> > +++ b/kernel/printk/printk.c
> > @@ -3735,6 +3735,14 @@ bool pr_flush(int timeout_ms, bool reset_on_progress)
> > diff = 0;
> > 
> > for_each_console(con) {
> > + /*
> > + * When we're in the unpreemptible context on the same cpu
> > + * with which the thread of console locates on, we should
> > + * ignore this console, because it's a vain.
> > + */
> > + if (!preemptible() && con->thread &&
> > + task_cpu(con->thread) == smp_processor_id())
> > + continue;
> > if (!(con->flags & CON_ENABLED))
> > continue;
> > printk_seq = read_console_seq(con);
> 
> This does not apply.
> There is `may_sleep' set earlier.
> 
> There is no console_lock() around for each…
> 

Sorry, I don't get it.

To clarify it again, this patch aims to solve the useless waiting of pr_flush
when the console is preempted by the current irq/softirq. This has nothing to
do with might_sleep().

> The other question is which kernel started enforcing might_sleep() for
> pr_flush(). This should be applied to all kernel or none so we don't
> have random behaviour across kernels (5.4 yes, 5.10 no, 5.15 yes).
>

Sorry, my understanding is that pr_flush didn't start enforcing might_sleep().
This patch can apply to 5.10 and 5.15 where the problem exist.

> This is a delay of max 1 sec during bug() and panic(). Not sure how
> "critical" this is…

In some industrial control scenarios, bugs and warnings containning a
pr_flush delay of 1 sec is very critical to the upper services.

Especiall for watchdog timeout(< 2s), just WARN can easily lead to system reset,
which is unacceptible.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ