cfg80211: avoid double free of PMSR request
authorAvraham Stern <avraham.stern@intel.com>
Fri, 18 Jun 2021 10:41:31 +0000 (13:41 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 Jun 2021 11:25:24 +0000 (13:25 +0200)
commit0288e5e16a2e18f0b7e61a2b70d9037fc6e4abeb
treec41e742dd0398226a2e9a870caf084a615a3bf9b
parentb5642479b0f7168fe16d156913533fe65ab4f8d5
cfg80211: avoid double free of PMSR request

If cfg80211_pmsr_process_abort() moves all the PMSR requests that
need to be freed into a local list before aborting and freeing them.
As a result, it is possible that cfg80211_pmsr_complete() will run in
parallel and free the same PMSR request.

Fix it by freeing the request in cfg80211_pmsr_complete() only if it
is still in the original pmsr list.

Cc: stable@vger.kernel.org
Fixes: 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM initiator API")
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618133832.1fbef57e269a.I00294bebdb0680b892f8d1d5c871fd9dbe785a5e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/pmsr.c