From: Kalle Valo <kvalo@codeaurora.org>
To: Hang Zhang <zh.nvgt@gmail.com>
Cc: unlisted-recipients:; (no To-header on input) Solomon Peachy
<pizza@shaftnet.org>, "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jia-Ju Bai <baijiaju1990@gmail.com>,
Wei Yongjun <weiyongjun1@huawei.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Hang Zhang <zh.nvgt@gmail.com>
Subject: Re: [PATCH] cw1200: Revert unnecessary patches that fix unreal use-after-free bugs
Date: Tue, 15 Jun 2021 13:41:33 +0000 (UTC) [thread overview]
Message-ID: <20210615134133.1BACCC43460@smtp.codeaurora.org> (raw)
In-Reply-To: <20210521223238.25020-1-zh.nvgt@gmail.com>
Hang Zhang <zh.nvgt@gmail.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@gmail.com>
> Acked-by: Jia-Ju Bai <baijiaju1990@gmail.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
prev parent reply other threads:[~2021-06-15 13:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 22:32 [PATCH] cw1200: Revert unnecessary patches that fix unreal use-after-free bugs Hang Zhang
2021-05-24 1:36 ` Jia-Ju Bai
2021-06-15 13:41 ` Kalle Valo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210615134133.1BACCC43460@smtp.codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=zh.nvgt@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).