[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230313110256.driiufx5edha7xhh@fpc>
Date: Mon, 13 Mar 2023 14:02:56 +0300
From: Fedor Pchelkin <pchelkin@...ras.ru>
To: syzbot+df61b36319e045c00a08@...kaller.appspotmail.com
Cc: syzkaller-bugs@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [syzbot] [wireless?] KMSAN: uninit-value in ath9k_hw_init
#syz test: https://github.com/google/kmsan.git master
--- a/drivers/net/wireless/ath/ath9k/wmi.c
+++ b/drivers/net/wireless/ath/ath9k/wmi.c
@@ -221,6 +221,9 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
if (unlikely(wmi->stopped))
goto free_skb;
+ if (unlikely(skb->len < sizeof(struct wmi_cmd_hdr)))
+ goto free_skb;
+
hdr = (struct wmi_cmd_hdr *) skb->data;
cmd_id = be16_to_cpu(hdr->command_id);
@@ -308,8 +311,11 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id,
unsigned long time_left;
int ret = 0;
- if (ah->ah_flags & AH_UNPLUGGED)
- return 0;
+ if (ah->ah_flags & AH_UNPLUGGED) {
+ ath_dbg(common, WMI, "Device unplugged for WMI command: %s\n",
+ wmi_cmd_to_name(cmd_id));
+ return -ENODEV;
+ }
skb = alloc_skb(headroom + cmd_len, GFP_ATOMIC);
if (!skb)
--
Powered by blists - more mailing lists