[PATCH] irqchip/gic-v5: Fix kmemleak L2 IST table entries false positives
Jinjie Ruan
ruanjinjie at huawei.com
Thu Aug 21 00:11:39 PDT 2025
On 2025/8/11 21:50, Lorenzo Pieralisi wrote:
> L2 IST table entries are allocated with the kmalloc interface
> and their physical addresses are programmed in the GIC (either
> IST base address register or L1 IST table entries) but their
> virtual addresses are not stored in any kernel data structure
> because they are not needed at runtime - the L2 IST table entries
> are managed through system instructions but never dereferenced
> directly by the driver.
>
[...]
>
> Reported-by: Jinjie Ruan <ruanjinjie at huawei.com>
> Closes: https://lore.kernel.org/lkml/cc611dda-d1e4-4793-9bb2-0eaa47277584@huawei.com/
> Signed-off-by: Lorenzo Pieralisi <lpieralisi at kernel.org>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Cc: Marc Zyngier <maz at kernel.org>
> ---
> drivers/irqchip/irq-gic-v5-irs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
> index ad1435a858a4..e8a576f66366 100644
> --- a/drivers/irqchip/irq-gic-v5-irs.c
> +++ b/drivers/irqchip/irq-gic-v5-irs.c
> @@ -5,6 +5,7 @@
>
> #define pr_fmt(fmt) "GICv5 IRS: " fmt
>
> +#include <linux/kmemleak.h>
> #include <linux/log2.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> @@ -117,6 +118,7 @@ static int __init gicv5_irs_init_ist_linear(struct gicv5_irs_chip_data *irs_data
> kfree(ist);
> return ret;
> }
> + kmemleak_ignore(ist);
>
> return 0;
> }
> @@ -232,6 +234,7 @@ int gicv5_irs_iste_alloc(const u32 lpi)
> kfree(l2ist);
> return ret;
> }
> + kmemleak_ignore(l2ist);
Reviewed-by: Jinjie Ruan <ruanjinjie at huawei.com>
>
> /*
> * Make sure we invalidate the cache line pulled before the IRS
More information about the linux-arm-kernel
mailing list