Skip to content
Commit 7bc40aed authored by Johannes Berg's avatar Johannes Berg
Browse files

mac80211: free sta in sta_info_insert_finish() on errors



If sta_info_insert_finish() fails, we currently keep the station
around and free it only in the caller, but there's only one such
caller and it always frees it immediately.

As syzbot found, another consequence of this split is that we can
put things that sleep only into __cleanup_single_sta() and not in
sta_info_free(), but this is the only place that requires such of
sta_info_free() now.

Change this to free the station in sta_info_insert_finish(), in
which case we can still sleep. This will also let us unify the
cleanup code later.

Cc: stable@vger.kernel.org
Fixes: dcd479e1 ("mac80211: always wind down STA state")
Reported-by: default avatar <syzbot+32c6c38c4812d22f2f0b@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+4c81fe92e372d26c4246@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+6a7fe9faf0d1d61bc24a@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+abed06851c5ffe010921@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+b7aeb9318541a1c709f1@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+d5a9416c6cafe53b5dd0@syzkaller.appspotmail.com>
Link: https://lore.kernel.org/r/20201112112201.ee6b397b9453.I9c31d667a0ea2151441cc64ed6613d36c18a48e0@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent b2911a84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment