From: Roshan Kumar <roshaen09@gmail.com>
To: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Alexander Aring <alex.aring@gmail.com>,
Stefan Schmidt <stefan@datenfreihafen.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Yousef Alhouseen <alhouseenyousef@gmail.com>
Subject: [PATCH net v2 0/2] ieee802154: hwsim: fix PIB lifetime during teardown and error unwind
Date: Sun, 6 Dec 2026 13:30:34 +0530 [thread overview]
Message-ID: <20261206080036.2769662-1-roshaen09@gmail.com> (raw)
Miquel asked me to forward Yousef's teardown fix after no v2 was posted.
Patch 1 preserves Yousef's authorship and existing Signed-off-by. It moves
the final PIB lookup and free after unregistering the hardware, uses
rcu_access_pointer() as requested, and corrects the Fixes tag after checking
the file history.
Patch 2 fixes the related error unwind issue reported by Sashiko. Once the
PHY is published, a callback can replace phy->pib and queue the original
object for RCU freeing. The unwind must therefore free the final published
PIB rather than the stale local pointer.
OpenAI Codex assisted with the lifetime analysis, the two-line second fix,
commit and cover letter drafting, and test automation. The Codex session was
prompted to trace PIB ownership through registration, callback replacement,
error unwind, and teardown; minimize the fixes; inspect history and credit;
and construct deterministic KASAN and failslab validation.
Testing:
- full KASAN W=1 bzImage and hwsim module build after patch 1, followed
by a successful incremental W=1 hwsim module rebuild after patch 2
- targeted W=1 allmodconfig and allyesconfig builds, with no hwsim
diagnostics
- patch 1 only: one deterministic fault-injection round reproduced the
KASAN double-free in hwsim_add_one()
- patch 1 plus patch 2: 100 deterministic fault-injection rounds, with no
sanitizer findings
- patch 1 plus patch 2: 200 teardown race rounds, with no sanitizer
findings
The fault-injection test used a temporary, unsubmitted module parameter to
pause the second probe after PHY publication. Both interfaces were opened to
replace their PIBs, then task-filtered failslab forced hwsim_alloc_edge() to
fail. An RCU barrier drained all deferred frees after every round.
v1:
https://lore.kernel.org/r/20260627235805.17310-1-alhouseenyousef@gmail.com/
Forwarding request:
https://lore.kernel.org/r/87wlqbn514.fsf@bootlin.com/
Sashiko report:
https://lore.kernel.org/r/179492373789.3136.2399679338709401263@kernel.org/
Roshan Kumar (1):
ieee802154: hwsim: free the current PIB on registration failure
Yousef Alhouseen (1):
ieee802154: hwsim: free PIB after unregistering hardware
drivers/net/ieee802154/mac802154_hwsim.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
base-commit: bc10f5da3e77499a7024d4c2d263d3ca04f8481d
next reply other threads:[~2026-12-06 8:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 8:00 Roshan Kumar [this message]
2026-12-06 8:00 ` [PATCH net v2 1/2] ieee802154: hwsim: free PIB after unregistering hardware Roshan Kumar
2026-12-06 8:00 ` [PATCH net v2 2/2] ieee802154: hwsim: free the current PIB on registration failure Roshan Kumar
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=20261206080036.2769662-1-roshaen09@gmail.com \
--to=roshaen09@gmail.com \
--cc=alex.aring@gmail.com \
--cc=alhouseenyousef@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox