public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] Staging: rtl8192e: pointer math bug in rtllib_rx_DELBA()
@ 2015-07-17  9:24 Dan Carpenter
  2015-07-17 20:17 ` Mateusz Kulikowski
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dan Carpenter @ 2015-07-17  9:24 UTC (permalink / raw)
  To: kernel-janitors

The "delba" variable is a pointer to struct rtllib_hdr_3addr so this
pointer math bug means that we read nonsense data from beyond the end of
the buffer.  It could result in a oops if the memory is not mapped.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 60f536c..98e6c4e 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -453,7 +453,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
 #endif
 	delba = (struct rtllib_hdr_3addr *)skb->data;
 	dst = (u8 *)(&delba->addr2[0]);
-	delba += sizeof(struct rtllib_hdr_3addr);
+	delba++;
 	pDelBaParamSet = (union delba_param_set *)(delba+2);
 	pReasonCode = (u16 *)(delba+4);
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-19 18:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17  9:24 [patch 2/2] Staging: rtl8192e: pointer math bug in rtllib_rx_DELBA() Dan Carpenter
2015-07-17 20:17 ` Mateusz Kulikowski
2015-07-19 10:52   ` [patch 2/2 v2] " Dan Carpenter
2015-07-19 18:17     ` Mateusz Kulikowski
2015-07-18  7:31 ` [patch 2/2] " Dan Carpenter
2015-07-18  8:09 ` Dan Carpenter
2015-07-18 12:32 ` Malcolm Priestley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox