From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.177 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796544116; b=KHxLQYQbRK/AsKY3fudCzpahbzkwfeS9ETRTWfnB2M40r22hBmKiaM57kEVEo3dfHWWw OzId6eWe8gU6DpizasxKrYRNB1C12enmmevZrPdMbyRCx/N20SbUGGhkvjwjIEdM58pN2 CiiJhYBSJ5j4nx8ItPpoJnql0/oMAQWK679VNsPY2NePY/V8sSP/K773L5/3v/f1+Ys8h liKTZXCjal5IeU4Z9YqjhBQNeYFvAi56x6ijg7J1SDij2tRuoii0JPxR50T+KDRXPTC3I cQhFAs6eZssSD8hSkouTzvLXMzSndjEIk04smVEa28rourvpemOBe2dS2b6NufGeuoQ== 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-Forwarded-Encrypted: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=tyoz3rI256oMrpAlr+mMB5T+OLp7Hhyh/X2te8Je8rSte8PPaOehNbSEufWf219+pwqK SK5CgfM53T4hF1Dn7ybb0X2EBPtPdSgey4AqFOZJjDRfT3Phv5orXL4gtW7Db3b1Ioftw axMla6vQzDmmwKukZ/MFI3gcbinEJ8Pj+jOAcI74Pbnohza9Crgk3J/kqU6ulnVxVw70w YDR9R/TOmXXAjGidW/2ClcwH+dWxe0ZMNxPI6aTOJf1jWzFQeUlH9bmrI3q5LXz4N5wjz +JUJBQaJccosT5xE9FcwoS27f2yzAtw1CV6ASCl/4sfvvjy8bGGoJMCyYDn6wnuT3Wg== 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.177 Received: from mail-dy1-f177.google.com (mail-dy1-f177.google.com [74.125.82.177]) (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 D9774606A31F for ; Sun, 6 Dec 2026 08:01:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D9774606A31F 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-f177.google.com with SMTP id 5a478bee46e88-386c71feeeaso2997177eec.0 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=IP1kjaWgKjzVL9nLuiEbXggbbhOG5z7amrS3kBgN7zwV1Hd5mDQRp2UP+OFkK04GuC 2R4HUuP6c2S3wZTCbTW9TbNXFrjPY+XVfCrPcT4/GidWSokUR0miWc5j4fZTTHwddwmk q/2WX8tb8QqzswbvTPI7HF9AKndFtW9bfiz5ZvwVe7UTfxES1cuOKcoA7Gxcsqm6zPAz eneMZIy7VzKCwi1YHY+zpQV2DSl5tWAsB8OlrnNyPOtlYHqqHCMcyEN2+ZjUDU5AfNBC g4ZUJ5yJ8cNxqrl56YVXdq7oQeqYzzVsJz7/0uTVhQTEP+wQ8zomw41hXwNufRhHO9Ww St4g== X-Forwarded-Encrypted: i=1; AL+hErF9klDCFLI8u/x5n5Jy2cq77nFadr8STsZE0CWO9YgYml0c+bXBtDBeUTcuPbvtDl6gTm+Lp2E=@vger.kernel.org X-Gm-Message-State: AB4q+uFN/+ilwIui41mrWY7mIF3t5Hlnzg2EY9fRP9bZVciZ5fU+tvWe zuIr+41Zyi+KNeDwa9/LI+yItFssrZtuvLWuodmZaMC+xdnhyD5DyKz0 X-Gm-Gg: AZFdTZe7992I4lOg3G0IGuGehX+5Ooq1PDhJom5ufytcr3KQiEYLlLdUmeg4Ca3buDa D7P41r+lT0xADMwf9BOpjwuhlpLH9Pun6yirqt7eR/SjTupvI2l0bYhynvUWA7JtkyqD2zlfa+d YgcqUIXb9MQotF9jcaCkzLP+W1HZO5ZVykw0dXWHHLSuXnO483iJiOc5CQs+LYS+Y0rUlO7eNh9 4kBxWNos6pkPVWHROMokKjMdf9QxqJjqH3WY2gGGxqrBxuMtFnwaOIOCiN/3Hel1HzbcmbzZ54n okwztFgIhGyOSMAHhh5c+IiIprjFqHGsX90NKDYIuwPDV/sqKs2GXY8kcam912bWZ5wsTYnKg84 NuFnONdjANdq9SuSAO714qcUULSTf4NA4TGZtM9sYcGGkIA+45hDh4d+osUCrmseaXyoyx68zOF ll7tpC3HB8O+xkoBEbW5Sf/0P8+8lmSJv3gW+92E3v5jfMbYjl1z45W0nWbzAqcRxMVJyJVha0Z 45lFSB0CdiNV5NjIMHa0XeEm0bGp/5W16YAeb06dxy3GS0mmz7PZLyHGk3cCO4Wa3tZWBvLTniG FxVQnhpBAE5593R3z1Y= 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: netdev@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