]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/dibs: Correct freeing of dmb_clientid_arr
authorAlexandra Winter <wintera@linux.ibm.com>
Mon, 10 Aug 2026 11:14:32 +0000 (13:14 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 13 Aug 2026 00:08:05 +0000 (17:08 -0700)
commit9e6869be49064915edb6c8776b27c376cfdb0df5
tree0fcb511f2a853639e6f0e19a6d727503d09e2946
parent7b53449540502cb21b32bca62a6258e22cd97bbe
net/dibs: Correct freeing of dmb_clientid_arr

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@vger.kernel.org
Co-developed-by: Hidayath Khan <hidayath@linux.ibm.com>
Signed-off-by: Hidayath Khan <hidayath@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Link: https://patch.msgid.link/20260810111432.2334900-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dibs/dibs_loopback.c
drivers/dibs/dibs_main.c