]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mac80211_hwsim: Fix possible NULL dereference
authorIlan Peer <ilan.peer@intel.com>
Mon, 10 Nov 2025 12:01:54 +0000 (14:01 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Nov 2025 08:25:18 +0000 (09:25 +0100)
commiteaa7ce66c3e2ccda035022b5e8af09caabecd635
treeab8bc4903b73e60ea0c4cd1e54a1166b534e8cdb
parent7fe0d21f5633af8c3fab9f0ef0706c6156623484
wifi: mac80211_hwsim: Fix possible NULL dereference

The 'vif' pointer in the Tx information might be NULL, e.g., in
case of injected frames etc. and is not checked in all paths. Fix it.
While at it, also directly use the local 'vif' pointer.

Fixes: a37a6f54439b ("wifi: mac80211_hwsim: Add simulation support for NAN device")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-wireless/aNJUlyIiSTW9zZdr@stanley.mountain
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20251110140128.ec00ae795a32.I9c65659b52434189d8b2ba06710d482669a3887a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/virtual/mac80211_hwsim.c