]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mac80211: ibss: wait for in-flight TX on disconnect
authorPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Mon, 6 Jul 2026 19:37:56 +0000 (22:37 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Jul 2026 07:28:55 +0000 (09:28 +0200)
commitd0e69d9afa59b93c30294eba89b1f15f69e91105
tree79a1f92260bbbeb713df170a7fa8b79e7b3465b6
parent4e72459683b5185568e9ffe2584a7b834f7902b5
wifi: mac80211: ibss: wait for in-flight TX on disconnect

While leaving an IBSS in ieee80211_ibss_disconnect() mac80211 flushes
stations, turns the carrier off and immediately tells the driver to
leave as well. While there may be synchronize_net() in station flush
and in this code later, packets can still be transmitted due to
cross-CPU race conditions after carrier off is set.
Therefore, it's possible for a race to happen where a TX to the
driver occurs while or after telling it to leave the IBSS. This can
be confusing to drivers, and in the case of iwlwifi leads to an
attempt to use invalid queues.

Move netif_carrier_off() to occur before sta_info_flush() during
IBSS disconnect, and add synchronize_net() if flushing didn't,
so that the synchronize_net() always happens between turning the
carrier off and telling the driver, avoiding this race.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260706223751.da1ce439cc93.If5cf482f87ab98ce66dd48724e24c81fed236d3f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ibss.c