Re: [PATCH] RDMA/irdma: avoid invalid read in irdma_net_event

From: Jason Gunthorpe
Date: Wed Dec 17 2025 - 18:38:21 EST


On Thu, Nov 27, 2025 at 03:31:50PM +0100, Michal Schmidt wrote:
> irdma_net_event() should not dereference anything from "neigh" (alias
> "ptr") until it has checked that the event is NETEVENT_NEIGH_UPDATE.
> Other events come with different structures pointed to by "ptr" and they
> may be smaller than struct neighbour.
>
> Move the read of neigh->dev under the NETEVENT_NEIGH_UPDATE case.
>
> The bug is mostly harmless, but it triggers KASAN on debug kernels:
>
> Fixes: 915cc7ac0f8e ("RDMA/irdma: Add miscellaneous utility definitions")
> Signed-off-by: Michal Schmidt <mschmidt@xxxxxxxxxx>
> ---
> drivers/infiniband/hw/irdma/utils.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to for-rc, thanks

Jason