Re: [PATCH net] net/dibs: Correct freeing of dmb_clientid_arr
From: Alexandra Winter
Date: Tue Aug 11 2026 - 05:21:49 EST
On 10.08.26 13:14, Alexandra Winter wrote:
> A dibs device interrupt handler can be active after dibs_dev_del() and
> may still access dmb_clientid_arr. (UAF)
>
> In case of a failure in dibs_dev_add() being called by dibs_lo_dev_probe()
> dmb_clientid_arr is freed twice (double free).
>
> Free dmb_clientid_arr in dibs_dev_release() after last reference is gone.
> Note that allocating in dibs_dev_add() instead of dibs_dev_alloc() is ok
> for now, because no dmbs can be registered before dibs_dev_add().
>
> Fixes: cc21191b584c ("dibs: Move data path to dibs layer")
> Cc: stable@xxxxxxxxxxxxxxx
> Co-developed-by: Hidayath Khan <hidayath@xxxxxxxxxxxxx>
> Signed-off-by: Hidayath Khan <hidayath@xxxxxxxxxxxxx>
> Signed-off-by: Alexandra Winter <wintera@xxxxxxxxxxxxx>
> ---
> This is a squash of [1] and [2] as requested by Jakub.
>
> Simon and Dust Li, I'd appreciate, if you could double-check whether
> you can give R-b again.
>
> Link: https://lore.kernel.org/netdev/20260806120447.596164-1-hidayath@xxxxxxxxxxxxx/ [1]
> Link: https://lore.kernel.org/netdev/20260804085848.3579518-1-wintera@xxxxxxxxxxxxx/ [2]
Title should be 'dibs:' instead of 'net/dibs:' for commonality
dibs: Correct freeing of dmb_clientid_arr