Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Commit

Permalink
nl80211: fix station_info pertid memory leak
Browse files Browse the repository at this point in the history
When dumping stations, memory allocated for station_info's
pertid member will leak if the nl80211 header cannot be added to
the sk_buff due to insufficient tail room.

I noticed this leak in the kmalloc-2048 cache.

Cc: stable@vger.kernel.org
Fixes: 8689c05 ("cfg80211: dynamically allocate per-tid stats for station info")
Signed-off-by: Andy Strohman <andy@uplevelsystems.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
andrewstrohman authored and jmberg-intel committed May 28, 2019
1 parent a71fd9d commit f77bf48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -4859,8 +4859,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
struct nlattr *sinfoattr, *bss_param;

hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
if (!hdr)
if (!hdr) {
cfg80211_sinfo_release_content(sinfo);
return -1;
}

if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) ||
Expand Down

0 comments on commit f77bf48

Please sign in to comment.