]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: iwlwifi: fix potential use after free in iwl_mld_remove_link()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 23 Sep 2025 11:20:16 +0000 (14:20 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 19 Oct 2025 12:12:36 +0000 (15:12 +0300)
commit77e67d5daaf155f7d0f99f4e797c4842169ec19e
treea0ce2c20b6d717a469c96ffb31cfe772eff068e3
parent4ff71af020ae59ae2d83b174646fc2ad9fcd4dc4
wifi: iwlwifi: fix potential use after free in iwl_mld_remove_link()

This code frees "link" by calling kfree_rcu(link, rcu_head) and then it
dereferences "link" to get the "link->fw_id".  Save the "link->fw_id"
first to avoid a potential use after free.

Fixes: d1e879ec600f ("wifi: iwlwifi: add iwlmld sub-driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aNKCcKlbSkkS4_gO@stanley.mountain
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/link.c