From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jiawei Ye <jiawei.ye@foxmail.com>
Cc: przemyslaw.kitszel@intel.com, alex.aring@gmail.com,
stefan@datenfreihafen.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
david.girault@qorvo.com, linux-wpan@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mac802154: Fix potential RCU dereference issue in mac802154_scan_worker
Date: Fri, 20 Sep 2024 13:21:31 +0200 [thread overview]
Message-ID: <20240920132131.466e5636@xps-13> (raw)
In-Reply-To: <tencent_3D3535F93CE8BC48A50E29D1CF7A25E93D0A@qq.com>
Hi Jiawei,
jiawei.ye@foxmail.com wrote on Fri, 20 Sep 2024 04:03:32 +0000:
> In the `mac802154_scan_worker` function, the `scan_req->type` field was
> accessed after the RCU read-side critical section was unlocked. According
> to RCU usage rules, this is illegal and can lead to unpredictable
> behavior, such as accessing memory that has been updated or causing
> use-after-free issues.
>
> This possible bug was identified using a static analysis tool developed
> by myself, specifically designed to detect RCU-related issues.
>
> To address this, the `scan_req->type` value is now stored in a local
> variable `scan_req_type` while still within the RCU read-side critical
> section. The `scan_req_type` is then used after the RCU lock is released,
> ensuring that the type value is safely accessed without violating RCU
> rules.
>
> Fixes: e2c3e6f53a7a ("mac802154: Handle active scanning")
> Signed-off-by: Jiawei Ye <jiawei.ye@foxmail.com>
I think net maintainers now expect the Cc: stable tag to be put here
when there is a reason to backport, which I believe is the case here.
So please add this line here.
>
Please delete this blank line as well.
And with that you can add my:
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
Thanks,
Miquèl
next prev parent reply other threads:[~2024-09-20 11:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 4:03 [PATCH v2] mac802154: Fix potential RCU dereference issue in mac802154_scan_worker Jiawei Ye
2024-09-20 11:21 ` Miquel Raynal [this message]
2024-09-21 5:22 ` Jiawei Ye
2024-09-23 12:40 ` Stefan Schmidt
-- strict thread matches above, loose matches on Subject: below --
2024-09-21 4:19 Jiawei Ye
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=20240920132131.466e5636@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=david.girault@qorvo.com \
--cc=edumazet@google.com \
--cc=jiawei.ye@foxmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=stefan@datenfreihafen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.