[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <166546319878.5539.2693721312600090208.kvalo@kernel.org>
Date: Tue, 11 Oct 2022 04:40:00 +0000 (UTC)
From: Kalle Valo <kvalo@...nel.org>
To: Fedor Pchelkin <pchelkin@...ras.ru>
Cc: Toke Høiland-Jørgensen <toke@...e.dk>,
Fedor Pchelkin <pchelkin@...ras.ru>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Alexey Khoroshilov <khoroshilov@...ras.ru>,
lvc-project@...uxtesting.org
Subject: Re: [PATCH v2] ath9k: hif_usb: Fix use-after-free in
ath9k_hif_usb_reg_in_cb()
Fedor Pchelkin <pchelkin@...ras.ru> wrote:
> It is possible that skb is freed in ath9k_htc_rx_msg(), then
> usb_submit_urb() fails and we try to free skb again. It causes
> use-after-free bug. Moreover, if alloc_skb() fails, urb->context becomes
> NULL but rx_buf is not freed and there can be a memory leak.
>
> The patch removes unnecessary nskb and makes skb processing more clear: it
> is supposed that ath9k_htc_rx_msg() either frees old skb or passes its
> managing to another callback function.
>
> Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
>
> Fixes: 3deff76095c4 ("ath9k_htc: Increase URB count for REG_IN pipe")
> Signed-off-by: Fedor Pchelkin <pchelkin@...ras.ru>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
> Acked-by: Toke Høiland-Jørgensen <toke@...e.dk>
> Signed-off-by: Kalle Valo <quic_kvalo@...cinc.com>
Patch applied to ath-next branch of ath.git, thanks.
dd95f2239fc8 wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
--
https://patchwork.kernel.org/project/linux-wireless/patch/20221008114917.21404-1-pchelkin@ispras.ru/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists