]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mwifiex: add mutex lock for call in mwifiex_dfs_chan_sw_work_queue
authorNiels Dossche <dossche.niels@gmail.com>
Mon, 21 Mar 2022 22:55:16 +0000 (23:55 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:37 +0000 (09:23 +0200)
commit40c90cc8cf1942ca9633e94bfcbe6cf89446ecbe
tree68e8bcbcf64a5d6cdc6c6175afab268a5114e179
parentd1858eb77a3e9ea6b2362fdc69f73b96301daef9
mwifiex: add mutex lock for call in mwifiex_dfs_chan_sw_work_queue

BugLink: https://bugs.launchpad.net/bugs/1981864
[ Upstream commit 3e12968f6d12a34b540c39cbd696a760cc4616f0 ]

cfg80211_ch_switch_notify uses ASSERT_WDEV_LOCK to assert that
net_device->ieee80211_ptr->mtx (which is the same as priv->wdev.mtx)
is held during the function's execution.
mwifiex_dfs_chan_sw_work_queue is one of its callers, which does not
hold that lock, therefore violating the assertion.
Add a lock around the call.

Disclaimer:
I am currently working on a static analyser to detect missing locks.
This was a reported case. I manually verified the report by looking
at the code, so that I do not send wrong information or patches.
After concluding that this seems to be a true positive, I created
this patch.
However, as I do not in fact have this particular hardware,
I was unable to test it.

Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220321225515.32113-1-dossche.niels@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/wireless/marvell/mwifiex/11h.c