]> git.ipfire.org Git - thirdparty/hostap.git/commit
nl80211: MLD: Fix is_shared_drv ops logic when num links is one
authorGanesh Kariganuru Mahabalesh <quic_gkarigan@quicinc.com>
Thu, 25 Apr 2024 10:15:25 +0000 (15:45 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 9 Aug 2024 07:05:39 +0000 (10:05 +0300)
commitc3beaf6b86f96dd5a927fadb9d6a9039244b8fc6
tree9bcf8807e2695e4255539dbdff712060e68bcb7a
parent3e420372e714cc253444e2373d5fff66ca97ec5d
nl80211: MLD: Fix is_shared_drv ops logic when num links is one

Whenever there is only one BSS left and if the number of links is one,
is_shared_drv() returns false assuming no one else is sharing the driver
interface. However, when the number of links is one, this does not
guarantee that the caller's link ID is the only active link ID. If this
is not the case and false is returned, the caller calls hapd_deinit()
which will free the driver interface. However, when the actual active
link_id reaches deinit path, this leads to dereferencing a NULL pointer
ultimately leading to segmentation fault.

To prevent this, pass the link ID into the is_drv_shared() ops and match
it with only with active link IDs. Only return false if they are same.

Signed-off-by: Ganesh Kariganuru Mahabalesh <quic_gkarigan@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
src/ap/hostapd.c
src/drivers/driver.h
src/drivers/driver_nl80211.c