[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20210615134133.1BACCC43460@smtp.codeaurora.org>
Date: Tue, 15 Jun 2021 13:41:33 +0000 (UTC)
From: Kalle Valo <kvalo@...eaurora.org>
To: Hang Zhang <zh.nvgt@...il.com>
Cc: unlisted-recipients:; (no To-header on input)
Solomon Peachy <pizza@...ftnet.org>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Jia-Ju Bai <baijiaju1990@...il.com>,
Wei Yongjun <weiyongjun1@...wei.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Hang Zhang <zh.nvgt@...il.com>
Subject: Re: [PATCH] cw1200: Revert unnecessary patches that fix unreal
use-after-free bugs
Hang Zhang <zh.nvgt@...il.com> wrote:
> A previous commit 4f68ef64cd7f ("cw1200: Fix concurrency
> use-after-free bugs in cw1200_hw_scan()") tried to fix a seemingly
> use-after-free bug between cw1200_bss_info_changed() and
> cw1200_hw_scan(), where the former frees a sk_buff pointed
> to by frame.skb, and the latter accesses the sk_buff
> pointed to by frame.skb. However, this issue should be a
> false alarm because:
>
> (1) "frame.skb" is not a shared variable between the above
> two functions, because "frame" is a local function variable,
> each of the two functions has its own local "frame" - they
> just happen to have the same variable name.
>
> (2) the sk_buff(s) pointed to by these two "frame.skb" are
> also two different object instances, they are individually
> allocated by different dev_alloc_skb() within the two above
> functions. To free one object instance will not invalidate
> the access of another different one.
>
> Based on these facts, the previous commit should be unnecessary.
> Moreover, it also introduced a missing unlock which was
> addressed in a subsequent commit 51c8d24101c7 ("cw1200: fix missing
> unlock on error in cw1200_hw_scan()"). Now that the
> original use-after-free is unreal, these two commits should
> be reverted. This patch performs the reversion.
>
> Fixes: 4f68ef64cd7f ("cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan()")
> Fixes: 51c8d24101c7 ("cw1200: fix missing unlock on error in cw1200_hw_scan()")
> Signed-off-by: Hang Zhang <zh.nvgt@...il.com>
> Acked-by: Jia-Ju Bai <baijiaju1990@...il.com>
Patch applied to wireless-drivers-next.git, thanks.
3f60f4685699 cw1200: Revert unnecessary patches that fix unreal use-after-free bugs
--
https://patchwork.kernel.org/project/linux-wireless/patch/20210521223238.25020-1-zh.nvgt@gmail.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists