[lkml]   [2021]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] ath9k: ath9k_htc_rx_msg: return when sk_buff is too small
At the start of ath9k_htc_rx_msg, we check to see if the skb pointer is
valid, but what we don't do is check if it is large enough to contain a
valid struct htc_frame_hdr. We should check for this and return, as the
buffer is invalid in this case. Fixes a KMSAN-found uninit-value bug
reported by syzbot at:

Signed-off-by: Phillip Potter <>
drivers/net/wireless/ath/ath9k/htc_hst.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 510e61e97dbc..9dbfff7a388e 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -403,7 +403,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
struct htc_endpoint *endpoint;
__be16 *msg_id;

- if (!htc_handle || !skb)
+ if (!htc_handle || !skb || !pskb_may_pull(skb, sizeof(struct htc_frame_hdr)))

htc_hdr = (struct htc_frame_hdr *) skb->data;
 \ /
  Last update: 2021-05-02 22:26    [W:0.064 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site