Re: [PATCH 03/10] mailbox: riscv-sbi-mpxy: Protect per-CPU shmem access with irqsave

From: Lee Jones

Date: Thu Dec 03 2026 - 10:06:03 EST


On Thu, 03 Dec 2026, Rahul Pathak wrote:

> On Thu, Dec 3, 2026 at 1:59 PM Lee Jones <lee@xxxxxxxxxx> wrote:
> >
> > The SBI MPXY helpers evaluate this_cpu_ptr(&mpxy_local) before calling
> > get_cpu(), allowing CPU migration between computing the per-CPU pointer
> > and disabling preemption. They also leave local interrupts enabled
> > while using the per-CPU shared memory buffer, allowing a hardirq caller
> > (such as mbox_send_message() or mpxy_mbox_msi_write()) to clobber the
> > shared memory buffer mid-operation.
> >
> > Use guard(irqsave)() across all per-CPU shared memory helpers and fetch
> > this_cpu_ptr(&mpxy_local) inside the IRQ-disabled section.
> >
> > Fixes: bf3022a4eb11 ("mailbox: Add RISC-V SBI message proxy (MPXY) based mailbox driver")
> > Closes: https://sashiko.dev/#/bug/linux-d2c1eefe-4777-4ad6-94c5-504e347f3add
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
> > ---
> >
>
> This patch is not needed as its being
> already taken care by earlier patch sent
> but not yet merged -
> https://lists.infradead.org/pipermail/linux-riscv/2026-November/104034.html

Noted. Thanks for letting me know.

--
Lee Jones