Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] ieee802154: hwsim: fix PIB lifetime during teardown and error unwind
@ 2026-12-06  8:00 Roshan Kumar
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Roshan Kumar @ 2026-12-06  8:00 UTC (permalink / raw)
  To: linux-wpan, netdev, Miquel Raynal
  Cc: Alexander Aring, Stefan Schmidt, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yousef Alhouseen

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-06  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06  8:00 [PATCH net v2 0/2] ieee802154: hwsim: fix PIB lifetime during teardown and error unwind Roshan Kumar
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox