[PATCH 1/2] powerpc/pseries/msi: Fix potential underflow and leak issue
Cédric Le Goater
clg at kaod.org
Mon Aug 4 20:18:47 AEST 2025
On 8/4/25 12:07, Nam Cao wrote:
> pseries_irq_domain_alloc() allocates interrupts at parent's interrupt
> domain. If it fails in the progress, all allocated interrupts are
> freed.
>
> The number of successfully allocated interrupts so far is stored
> "i". However, "i - 1" interrupts are freed. This is broken:
>
> - One interrupt is not be freed
>
> - If "i" is zero, "i - 1" wraps around
>
> Correct the number of freed interrupts to 'i'.
>
> Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains")
> Signed-off-by: Nam Cao <namcao at linutronix.de>
> Cc: stable at vger.kernel.org
> ---
> arch/powerpc/platforms/pseries/msi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Cédric Le Goater <clg at redhat.com>
Thanks,
C.
More information about the Linuxppc-dev
mailing list