netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix stack-out-of-bounds Write in ath9k_hif_usb_rx_cb
@ 2020-03-31  3:28 Qiujun Huang
  2020-03-31 11:03 ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: Qiujun Huang @ 2020-03-31  3:28 UTC (permalink / raw)
  To: ath9k-devel, kvalo
  Cc: davem, linux-wireless, netdev, linux-kernel, anenbupt,
	Qiujun Huang

Add barrier to accessing the stack array skb_pool.

Reported-by: syzbot+d403396d4df67ad0bd5f@syzkaller.appspotmail.com
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
 drivers/net/wireless/ath/ath9k/hif_usb.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index dd0c323..c4a2b72 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -612,6 +612,11 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev,
 			hif_dev->remain_skb = nskb;
 			spin_unlock(&hif_dev->rx_lock);
 		} else {
+			if (pool_index == MAX_PKT_NUM_IN_TRANSFER) {
+				dev_err(&hif_dev->udev->dev,
+					"ath9k_htc: over RX MAX_PKT_NUM\n");
+				goto err;
+			}
 			nskb = __dev_alloc_skb(pkt_len + 32, GFP_ATOMIC);
 			if (!nskb) {
 				dev_err(&hif_dev->udev->dev,
-- 
1.8.3.1


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

end of thread, other threads:[~2020-03-31 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31  3:28 [PATCH] ath9k: fix stack-out-of-bounds Write in ath9k_hif_usb_rx_cb Qiujun Huang
2020-03-31 11:03 ` Kalle Valo
2020-03-31 11:21   ` Qiujun Huang
2020-03-31 11:39   ` Qiujun Huang

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