linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mwifiex: potential integer underflow in mwifiex_ret_wmm_get_status()
@ 2013-09-25  8:57 Dan Carpenter
  2013-09-25 16:25 ` Bing Zhao
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2013-09-25  8:57 UTC (permalink / raw)
  To: Bing Zhao; +Cc: John W. Linville, linux-wireless, kernel-janitors

If "resp_len" gets set to negative then it counts as a high positive
value.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I spotted this reviewing the int => bool changes, but I don't have the
hardware and can't test it.

diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 2e8f9cd..3c6ee3a 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -772,6 +772,8 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
 			break;
 		}
 
+		if (resp_len < tlv_len + sizeof(tlv_hdr->header))
+			break;
 		curr += (tlv_len + sizeof(tlv_hdr->header));
 		resp_len -= (tlv_len + sizeof(tlv_hdr->header));
 	}

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

end of thread, other threads:[~2013-10-10 18:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25  8:57 [patch] mwifiex: potential integer underflow in mwifiex_ret_wmm_get_status() Dan Carpenter
2013-09-25 16:25 ` Bing Zhao
2013-09-25 18:23   ` Dan Carpenter
2013-09-25 23:10     ` Bing Zhao
2013-09-26 20:57       ` Bing Zhao
2013-09-26 21:07         ` Dan Carpenter
2013-09-26 21:57           ` Bing Zhao
2013-10-10 17:26             ` John W. Linville
2013-10-10 18:02               ` Bing Zhao

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).