Skip to content

Commit 72dc678

Browse files
andrewstrohmangregkh
authored andcommitted
nl80211: fix station_info pertid memory leak
commit f77bf48 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1e1007a commit 72dc678

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

net/wireless/nl80211.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4611,8 +4611,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
46114611
struct nlattr *sinfoattr, *bss_param;
46124612

46134613
hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
4614-
if (!hdr)
4614+
if (!hdr) {
4615+
cfg80211_sinfo_release_content(sinfo);
46154616
return -1;
4617+
}
46164618

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

0 commit comments

Comments
 (0)