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]
Date:   Tue, 8 Jun 2021 19:59:23 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     qiang.zhang@...driver.com
Cc:     ryabinin.a.a@...il.com, glider@...gle.com, dvyukov@...gle.com,
        matthias.bgg@...il.com, andreyknvl@...gle.com,
        akpm@...ux-foundation.org, oleg@...hat.com,
        walter-zh.wu@...iatek.com, frederic@...nel.org,
        kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org
Subject: [PATCH] irq_work: Make irq_work_queue() NMI-safe again

On Tue, Jun 08, 2021 at 07:51:02PM +0200, Peter Zijlstra wrote:
> On Wed, Mar 31, 2021 at 02:32:02PM +0800, qiang.zhang@...driver.com wrote:
> 
> > @@ -70,6 +70,9 @@ bool irq_work_queue(struct irq_work *work)
> >  	if (!irq_work_claim(work))
> >  		return false;
> >  
> > +	/*record irq_work call stack in order to print it in KASAN reports*/
> > +	kasan_record_aux_stack(work);
> > +
> >  	/* Queue the entry and raise the IPI if needed. */
> >  	preempt_disable();
> >  	__irq_work_queue_local(work);
> 
> Thanks for the Cc :/ Also NAK.
> 
> I shall go revert this instantly. KASAN is not NMI safe, while
> irq_work_queue() is very carefully crafted to be exactly that.

The below goes in tip/perf/urgent ASAP.

---
Subject: irq_work: Make irq_work_queue() NMI-safe again
From: Peter Zijlstra <peterz@...radead.org>
Date: Tue Jun  8 19:54:15 CEST 2021

Someone carelessly put NMI unsafe code in irq_work_queue(), breaking
just about every single user. Also, someone has a terrible comment
style.

Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
 kernel/irq_work.c |    3 ---
 1 file changed, 3 deletions(-)

--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -70,9 +70,6 @@ bool irq_work_queue(struct irq_work *wor
 	if (!irq_work_claim(work))
 		return false;
 
-	/*record irq_work call stack in order to print it in KASAN reports*/
-	kasan_record_aux_stack(work);
-
 	/* Queue the entry and raise the IPI if needed. */
 	preempt_disable();
 	__irq_work_queue_local(work);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ