netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sara Sharon <sara.sharon@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 81/97] mac80211: free skb fraglist before freeing the skb
Date: Wed, 26 Dec 2018 17:35:41 -0500	[thread overview]
Message-ID: <20181226223557.149329-81-sashal@kernel.org> (raw)
In-Reply-To: <20181226223557.149329-1-sashal@kernel.org>

From: Sara Sharon <sara.sharon@intel.com>

[ Upstream commit 34b1e0e9efe101822e83cc62d22443ed3867ae7a ]

mac80211 uses the frag list to build AMSDU. When freeing
the skb, it may not be really freed, since someone is still
holding a reference to it.
In that case, when TCP skb is being retransmitted, the
pointer to the frag list is being reused, while the data
in there is no longer valid.
Since we will never get frag list from the network stack,
as mac80211 doesn't advertise the capability, we can safely
free and nullify it before releasing the SKB.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mac80211/status.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 7fa10d06cc51..534a604b75c2 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -556,6 +556,11 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local,
 	}
 
 	ieee80211_led_tx(local);
+
+	if (skb_has_frag_list(skb)) {
+		kfree_skb_list(skb_shinfo(skb)->frag_list);
+		skb_shinfo(skb)->frag_list = NULL;
+	}
 }
 
 /*
-- 
2.19.1

  parent reply	other threads:[~2018-12-26 22:35 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181226223557.149329-1-sashal@kernel.org>
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 16/97] xfrm: Fix error return code in xfrm_output_one() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 17/97] xfrm: Fix bucket count reported to userspace Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 18/97] xfrm: Fix NULL pointer dereference in xfrm_input when skb_dst_force clears the dst_entry Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 19/97] ieee802154: hwsim: fix off-by-one in parse nested Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 20/97] netfilter: nf_tables: fix suspicious RCU usage in nft_chain_stats_replace() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 21/97] netfilter: seqadj: re-load tcp header pointer after possible head reallocation Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 26/97] ibmvnic: Convert reset work item mutex to spin lock Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 27/97] ibmvnic: Fix non-atomic memory allocation in IRQ context Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 28/97] nfp: flower: ensure TCP flags can be placed in IPv6 frame Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 29/97] ieee802154: ca8210: fix possible u8 overflow in ca8210_rx_done Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 32/97] i40e: fix mac filter delete when setting mac address Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 33/97] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 34/97] ixgbe: Fix race when the VF driver does a reset Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 35/97] netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 36/97] netfilter: nat: can't use dst_hold on noref dst Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 37/97] netfilter: nf_conncount: use rb_link_node_rcu() instead of rb_link_node() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 38/97] bnx2x: Clear fip MAC when fcoe offload support is disabled Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 39/97] bnx2x: Remove configured vlans as part of unload sequence Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 40/97] bnx2x: Send update-svid ramrod with retry/poll flags enabled Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 43/97] net/mlx5e: RX, Verify MPWQE stride size is in range Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 44/97] net/mlx5e: Cancel DIM work on close SQ Sasha Levin
     [not found] ` <20181226223557.149329-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-12-26 22:35   ` [PATCH AUTOSEL 4.19 45/97] mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 47/97] qed: Fix command number mismatch between driver and the mfw Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 48/97] drivers: net: xgene: Remove unnecessary forward declarations Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 49/97] net/tls: Init routines in create_ctx Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 50/97] w90p910_ether: remove incorrect __init annotation Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 51/97] qmi_wwan: Added support for Fibocom NL668 series Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 52/97] qmi_wwan: Added support for Telit LN940 series Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 53/97] net: clear skb->tstamp in forwarding paths Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 54/97] net: hns: Incorrect offset address used for some registers Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 55/97] net: hns: All ports can not work when insmod hns ko after rmmod Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 56/97] net: hns: Some registers use wrong address according to the datasheet Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 57/97] net: hns: Fixed bug that netdev was opened twice Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 58/97] net: hns: Clean rx fbd when ae stopped Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 59/97] net: hns: Free irq when exit from abnormal branch Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 60/97] net: hns: Avoid net reset caused by pause frames storm Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 61/97] net: hns: Fix ntuple-filters status error Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 62/97] net: hns: Add mac pcs config when enable|disable mac Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 63/97] net: hns: Fix ping failed when use net bridge and send multicast Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 64/97] net: mvneta: fix operation for 64K PAGE_SIZE Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 65/97] mac80211: fix a kernel panic when TXing after TXQ teardown Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 66/97] SUNRPC: Fix a race with XPRT_CONNECTING Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 67/97] mlxsw: core: Increase timeout during firmware flash process Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 68/97] net: mvpp2: 10G modes aren't supported on all ports Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 70/97] qed: Fix an error code qed_ll2_start_xmit() Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 71/97] net: stmmac: Fix an error code in probe() Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 72/97] net: macb: restart tx after tx used bit read Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 73/97] net: macb: fix random memory corruption on RX with 64-bit DMA Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 74/97] net: macb: fix dropped RX frames due to a race Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 75/97] net: macb: add missing barriers when reading descriptors Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 76/97] lan743x: Expand phy search for LAN7431 Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 77/97] lan78xx: Resolve issue with changing MAC address Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 78/97] xen/netfront: tolerate frags with no data Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 79/97] vxge: ensure data0 is initialized in when fetching firmware version information Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 80/97] nl80211: fix memory leak if validate_pae_over_nl80211() fails Sasha Levin
2018-12-26 22:35 ` Sasha Levin [this message]
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 84/97] net/mlx5e: RX, Fix wrong early return in receive queue poll Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 85/97] net/mlx5: Typo fix in del_sw_hw_rule Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 86/97] net/mlx5e: Remove the false indication of software timestamping support Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 88/97] lan743x: Remove MAC Reset from initialization Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 89/97] net: mvpp2: fix the phylink mode validation Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 90/97] mscc: Configured MAC entries should be locked Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 93/97] net: netxen: fix a missing check and an uninitialized use Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 94/97] qmi_wwan: Add support for Fibocom NL678 series Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 95/97] qmi_wwan: Fix qmap header retrieval in qmimux_rx_fixup Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181226223557.149329-81-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sara.sharon@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).