From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796544116; b=2ZRi7MiFymjsUuJFzx3rhS9Y5OgBhL0sQ3C2ISy1OOnF4oDvG22TEMYQLV/m/iC2V4I2 m4rrAeODpLicM5vYnU/hTE66O155R0uH3UdK681M4kDDD6CEBr/SiJ6icFEiPNL40/Lti MBxWrMkN7N+1HrxlegiExfi24lJh75lwT3HTYhnsi8nKegsuKMNnhTeud+Ah2w6zHMZJD Tf1jhQs3xL6VW9VsSAT/evGXymWIxSBTMIrudDi0zw/MgihEWgOxJcj4tU+kukKkCmtEW mh2II9HZ9U80561Y7Zsc1TxCgjRTh7poINRbzzp851bpB6/tYboA087Ii31mquLMYsA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796544116; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=IaEKpmOjVArY98HRQlYOBz8x7hW+XdTCn4Ft4I861vQ=; b=gRH+UWNO9uAyK+dFgCju+yUi8Y4z13C5jURFRjoWQXnlOI/UNl7kSqnX/E3q3VF1M0mb 7yPlH74C/7tPM55kr/VkNcpPOhGzwsHxTyrlnZpSAaa0bimUI5WcFpMf1/m1t8a+1heRc qCMB8d8TQrefB99TvpgTinQDHL4vq+dTBe6/yaczF2SzHf3xvgSVrTZxSRN8DyoDTy/Ds C677g9NcWN2T+DkmmOV2RqcyXyjjoZ8S6UwYjribM5E5nh/fuv13G5febpdZKupCVJkfj ig+7lXtKU/lhRMjPwPmjJ/SLvLnw9h/kvREgD0XFpGtkpl0Lg7Flp0x9l6dXha7KZCg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=x7UL4xdZ; arc=none smtp.remote-ip=74.125.82.174 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3E1E606A321 for ; Sun, 6 Dec 2026 08:01:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E3E1E606A321 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=x7UL4xdZ Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-38431138772so3349345eec.1 for ; Sun, 06 Dec 2026 00:01:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796544115; x=1797148915; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=IaEKpmOjVArY98HRQlYOBz8x7hW+XdTCn4Ft4I861vQ=; b=x7UL4xdZor9OVteIUPof73nCO/TZa77sMlefI54BsVImDZDiXJrCHYFIrLEjar/BCJ wtOOd3LhEpF5P5TcyjsiS2V6I1gD7sIVxgEYeQdlINGtmURaXYVacHxcrLQdjemt1//1 43FdItAWQsifqiM+oHj7y2R/2kq8CNVnhnXekveS5cSURhAJ0zhyn81o11xKyAegXfLR SiEVhHMyJNf8e1bz2VFo6q3wic5FwL7mbLR2dxYTQydBDmA8oxMt9HhZJVsoSMmaTVLM F1XUXStnLQX2V8a/5+2gD4ock0YT0/pZn7FuPCuxkfinqa4ZlAVc+M81KAN2WI2tsM+8 JSfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796544115; x=1797148915; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=IaEKpmOjVArY98HRQlYOBz8x7hW+XdTCn4Ft4I861vQ=; b=fx3bWkkRLD40toR9JqlrCrJOknlq4egOVdEE1yV+bZYNDiHhnScBGV/9dNY415mM8f SuLLV36P2yk8vRQ+by38ovazdH4CBaUtDp2dqzgHEQ+eyGPRPUPB6b2cEAwbXKYzR27m 1e2TZEIW/xocP9gztG2qh9xPqVGq6CSYMRRYQ5vR7lB7VU9eiKZZKNMYX1RGxJA6rsc3 b19A2ksvQGQ7F1xxYFy9cCSIEahrzJkDwJz5ngohwuyH93xMC3CmCu3y9Vb3T+qTZMc+ Kvm76XMTUWHjg+YVLeJ8VQiC0FHZeOTOKkHyVuAvbDnLas9/0pii67Ln6ahXq9CNqzlc +o3A== X-Gm-Message-State: AB4q+uF+M27G1DtOQLV6delBpqVSGBGWWsyKzZGwZtSFBen/q9pBVazV wKmfdZBLgMvyb70rIHFFo2nveAUlVPbVee7NcRL13cxp5JI+P539Ybazubr1AlpgNH9VGg== X-Gm-Gg: AZFdTZdKU6FoQv8rVwJoYOhiFFZBT6YH9w9d9GrL3vAUs21OFWsvMeRAGPSRg4cELVv W7WXhJn9KGr/rd0JPcJgkvKGcmWnVuEMlP2c4pasDAQEvOggahjX+Q7vTcmMSiE8Bg3lYl5IqcB gLsPe2KnJAwfr/QpIgulEzbJbtCCfwDk22o88MBnb2/KkgvpTDH24BPxSmX6qk7bb/vJhjD8iVg HoibktxAmtqNLBvYGWYGo8F+BUhmRv8PB+NQzOMwAqBCyKtr4cnqxGMpLU20/Dp5LJnHj3E3BaE 1mm50+7DtJY/PXQcbd2AdSXxOVMVOXT26KQJ1Le4UQFLacpqOK0M56Y5lW4vmLBHQ4rPqcfkTcR SlOoB8fJsobAEtgndgD50YqCdniWHmi3TESs8A9gAEfTCv3AfXXuiVCE/pegIj3rIXa50tBPAiy PpzdxJsawbMar5xRN5Y4f8tEnVbmBsu4fCqX3+nrRRL7DN8bB6cIAgU6PUaYGkTPKOq/lmTdYdR /D9KbZiP+W2SahIid0QIX9K8m6Rbe3gwPgmaxvb0IBCmCDGI69xa5EEyYhR2yHb5ztkGdxXx5ZG +fvQ3/1DCVsJwf3dbGg= X-Received: by 2002:a05:693c:41d3:20b0:387:2e08:8085 with SMTP id 5a478bee46e88-387521f255bmr7952042eec.31.1796544114714; Sun, 06 Dec 2026 00:01:54 -0800 (PST) Received: from fox.. ([43.242.224.196]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3875218c602sm38935351eec.7.2026.12.06.00.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 00:01:54 -0800 (PST) From: Roshan Kumar To: linux-wpan@vger.kernel.org, netdev@vger.kernel.org, Miquel Raynal Cc: Alexander Aring , Stefan Schmidt , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yousef Alhouseen 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 Message-ID: <20261206080036.2769662-1-roshaen09@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-wpan@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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