public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jun Miao <jun.miao@intel.com>
To: <elver@google.com>, <dvyukov@google.com>,
	<ryabinin.a.a@gmail.com>, <peterz@infradead.org>
Cc: <bigeasy@linutronix.de>, <qiang1.zhang@intel.com>,
	<andreyknvl@gmail.com>, <kasan-dev@googlegroups.com>,
	<linux-kernel@vger.kernel.org>, <akpm@linux-foundation.org>
Subject: Re: [PATCH] irq_work: Make irq_work_queue_on() NMI-safe again
Date: Wed, 27 Apr 2022 21:59:56 +0800	[thread overview]
Message-ID: <0c29e157-20dd-2f07-d1e5-a9f2ed7e28eb@intel.com> (raw)
In-Reply-To: <20220427135050.20566-1-jun.miao@intel.com>

Sorry, please ignore!


On 2022/4/27 21:50, Jun Miao wrote:
> We should not put NMI unsafe code in irq_work_queue_on().
>
> The KASAN of kasan_record_aux_stack_noalloc() is not NMI safe. Because which
> will call the spinlock. While the irq_work_queue_on() is also very carefully
> carfted to be exactly that.
> When unable CONFIG_SMP or local CPU, the irq_work_queue_on() is even same to
> irq_work_queue(). So delete KASAN instantly.
>
> Fixes: e2b5bcf9f5ba ("irq_work: record irq_work_queue() call stack")
> Suggested by: "Huang, Ying" <ying.huang@intel.com>
> Signed-off-by: Jun Miao <jun.miao@intel.com>
> Acked-by: Marco Elver <elver@google.com>
> ---
>   kernel/irq_work.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> index 7afa40fe5cc4..e7f48aa8d8af 100644
> --- a/kernel/irq_work.c
> +++ b/kernel/irq_work.c
> @@ -20,7 +20,6 @@
>   #include <linux/smp.h>
>   #include <linux/smpboot.h>
>   #include <asm/processor.h>
> -#include <linux/kasan.h>
>   
>   static DEFINE_PER_CPU(struct llist_head, raised_list);
>   static DEFINE_PER_CPU(struct llist_head, lazy_list);
> @@ -137,8 +136,6 @@ bool irq_work_queue_on(struct irq_work *work, int cpu)
>   	if (!irq_work_claim(work))
>   		return false;
>   
> -	kasan_record_aux_stack_noalloc(work);
> -
>   	preempt_disable();
>   	if (cpu != smp_processor_id()) {
>   		/* Arch remote IPI send/receive backend aren't NMI safe */

  reply	other threads:[~2022-04-27 14:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 13:50 [PATCH] irq_work: Make irq_work_queue_on() NMI-safe again Jun Miao
2022-04-27 13:59 ` Jun Miao [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-04-26 13:49 Jun Miao
2022-04-27  1:49 ` Jun Miao
2022-04-27 12:26   ` Marco Elver
2022-04-27 13:17     ` Jun Miao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c29e157-20dd-2f07-d1e5-a9f2ed7e28eb@intel.com \
    --to=jun.miao@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiang1.zhang@intel.com \
    --cc=ryabinin.a.a@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox