* Patch "rtl8xxxu: Fix memory leak in handling rxdesc16 packets" has been added to the 4.8-stable tree
@ 2016-11-08 16:46 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-11-08 16:46 UTC (permalink / raw)
To: Jes.Sorensen, gregkh, kvalo; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
rtl8xxxu: Fix memory leak in handling rxdesc16 packets
to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
rtl8xxxu-fix-memory-leak-in-handling-rxdesc16-packets.patch
and it can be found in the queue-4.8 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 1e54134ccad00f76ddf00f3e77db3dc8fdefbb47 Mon Sep 17 00:00:00 2001
From: Jes Sorensen <Jes.Sorensen@redhat.com>
Date: Thu, 29 Sep 2016 15:40:54 -0400
Subject: rtl8xxxu: Fix memory leak in handling rxdesc16 packets
From: Jes Sorensen <Jes.Sorensen@redhat.com>
commit 1e54134ccad00f76ddf00f3e77db3dc8fdefbb47 upstream.
A device running without RX package aggregation could return more data
in the USB packet than the actual network packet. In this case we
could would clone the skb but then determine that that there was no
packet to handle and exit without freeing the cloned skb first.
This has so far only been observed with 8188eu devices, but could
affect others.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -5201,7 +5201,12 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
pkt_offset = roundup(pkt_len + drvinfo_sz + desc_shift +
sizeof(struct rtl8xxxu_rxdesc16), 128);
- if (pkt_cnt > 1)
+ /*
+ * Only clone the skb if there's enough data at the end to
+ * at least cover the rx descriptor
+ */
+ if (pkt_cnt > 1 &&
+ urb_len > (pkt_offset + sizeof(struct rtl8xxxu_rxdesc16)))
next_skb = skb_clone(skb, GFP_ATOMIC);
rx_status = IEEE80211_SKB_RXCB(skb);
Patches currently in stable-queue which might be from Jes.Sorensen@redhat.com are
queue-4.8/rtl8xxxu-fix-memory-leak-in-handling-rxdesc16-packets.patch
queue-4.8/rtl8xxxu-fix-big-endian-problem-reporting-mactime.patch
queue-4.8/rtl8xxxu-fix-rtl8723bu-driver-reload-issue.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-08 16:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08 16:46 Patch "rtl8xxxu: Fix memory leak in handling rxdesc16 packets" has been added to the 4.8-stable tree gregkh
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).