From: Thomas Gleixner <tglx@linutronix.de>
To: Hogan Wang <hogan.wang@huawei.com>,
x86@kernel.org, dave.hansen@linux.intel.com, kvm@vger.kernel.org,
alex.williamson@redhat.com
Cc: weidong.huang@huawei.com, yechuan@huawei.com,
hogan.wang@huawei.com, wangxinxin.wang@huawei.com,
jianjay.zhou@huawei.com, wangjie88@huawei.com,
Marc Zyngier <maz@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/irq: Plug vector setup race
Date: Thu, 31 Jul 2025 14:45:45 +0200 [thread overview]
Message-ID: <87a54kil52.ffs@tglx> (raw)
In-Reply-To: <draft-87ikjhrhhh.ffs@tglx>
On Thu, Jul 24 2025 at 12:49, Thomas Gleixner wrote:
Hogan!
> Hogan reported a vector setup race, which overwrites the interrupt
> descriptor in the per CPU vector array resulting in a disfunctional device.
>
> CPU0 CPU1
> interrupt is raised in APIC IRR
> but not handled
> free_irq()
> per_cpu(vector_irq, CPU1)[vector] = VECTOR_SHUTDOWN;
>
> request_irq() common_interrupt()
> d = this_cpu_read(vector_irq[vector]);
>
> per_cpu(vector_irq, CPU1)[vector] = desc;
>
> if (d == VECTOR_SHUTDOWN)
> this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
>
> free_irq() cannot observe the pending vector in the CPU1 APIC as there is
> no way to query the remote CPUs APIC IRR.
>
> This requires that request_irq() uses the same vector/CPU as the one which
> was freed, but this also can be triggered by a spurious interrupt.
>
> Prevent this by reevaluating vector_irq under the vector lock, which is
> held by the interrupt activation code when vector_irq is updated.
Does this fix your problem?
Thanks,
tglx
next parent reply other threads:[~2025-07-31 12:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <draft-87ikjhrhhh.ffs@tglx>
2025-07-31 12:45 ` Thomas Gleixner [this message]
2025-08-01 14:56 ` [PATCH] x86/irq: Plug vector setup race Hogan Wang
2025-08-02 11:54 ` Thomas Gleixner
2025-08-02 12:18 ` [tip: x86/urgent] " tip-bot2 for Thomas Gleixner
2025-08-02 20:08 ` tip-bot2 for Thomas Gleixner
2025-08-04 22:42 ` tip-bot2 for Thomas Gleixner
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=87a54kil52.ffs@tglx \
--to=tglx@linutronix.de \
--cc=alex.williamson@redhat.com \
--cc=dave.hansen@linux.intel.com \
--cc=hogan.wang@huawei.com \
--cc=jianjay.zhou@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=wangjie88@huawei.com \
--cc=wangxinxin.wang@huawei.com \
--cc=weidong.huang@huawei.com \
--cc=x86@kernel.org \
--cc=yechuan@huawei.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