From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B15E437883D for ; Mon, 9 Mar 2026 11:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773056547; cv=none; b=AjZEni6vhCRDVxPR9IL1AHDbZsLvAei4gvWx3CYwDEiNTrsvpqtmT0h/flHdI/0ywuIxwJkDtvhJ6pJzcA8lJGkkoeCLTb7w1x8DkJmnN31r4HPtj0tUAKyp1roJuuVp+CT/AzJUSTD9syogJ736J0ODtcHm70h8U+LNvTibNJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773056547; c=relaxed/simple; bh=4yDM0lfF7BoqLhkv0025L9Q3UBy/NJWhMbxL+NknpAw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ch99QTjwlvuvEwFiB8quewlwLobKV2b6w1pAZbimlKnxl8yiXRoDYoti4ZUmTiRqA/oR7N+CJDUJo4JVz+tSKsQ469h+TURPo47JUcOxjDxDR4VhU1Eony0wZ2psWG2MiSpGvvvuhZMt5hITP0Vt7aDeMf3s15FHulVT+4ABOmY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aN7ZKl1L; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aN7ZKl1L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02938C2BC86; Mon, 9 Mar 2026 11:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773056547; bh=4yDM0lfF7BoqLhkv0025L9Q3UBy/NJWhMbxL+NknpAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aN7ZKl1LpmMEmMjO3zw6OjqC012WXyICK2VZKMx+RwibAscAtY+UD6Fy1wibBJ7Ed rNI5UoA4AmjN8BNVldKbp4zqZvokvRtVsEH4VQdf3JpByjLMNSahR1y4m7TohdUSXk C9b/WRvWipclUIrBrCpbiIptmsve6lU5QPiMcCyjJMvsKV7A7AyN/c1HjZW/jAjMVZ R16J15/vKOJP9+WFwchEU+HCMbV+iQcqEjC+/nT2PzC4zSgyyhg6ZsCG+1bH09e0ZW +VvJatKWP5Rl9LfWPIJxlH2a6EeFkF1j57/kSo2j8YuYgXW+V4GdO9rYunE2aId8L8 L8XnhlGfQ+jKQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Daniil Dulov , Johannes Berg , Sasha Levin Subject: [PATCH 5.15.y 2/2] wifi: cfg80211: cancel rfkill_block work in wiphy_unregister() Date: Mon, 9 Mar 2026 07:42:24 -0400 Message-ID: <20260309114224.831897-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309114224.831897-1-sashal@kernel.org> References: <2026030934-cocoa-wrangle-1781@gregkh> <20260309114224.831897-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Daniil Dulov [ Upstream commit 767d23ade706d5fa51c36168e92a9c5533c351a1 ] There is a use-after-free error in cfg80211_shutdown_all_interfaces found by syzkaller: BUG: KASAN: use-after-free in cfg80211_shutdown_all_interfaces+0x213/0x220 Read of size 8 at addr ffff888112a78d98 by task kworker/0:5/5326 CPU: 0 UID: 0 PID: 5326 Comm: kworker/0:5 Not tainted 6.19.0-rc2 #2 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: events cfg80211_rfkill_block_work Call Trace: dump_stack_lvl+0x116/0x1f0 print_report+0xcd/0x630 kasan_report+0xe0/0x110 cfg80211_shutdown_all_interfaces+0x213/0x220 cfg80211_rfkill_block_work+0x1e/0x30 process_one_work+0x9cf/0x1b70 worker_thread+0x6c8/0xf10 kthread+0x3c5/0x780 ret_from_fork+0x56d/0x700 ret_from_fork_asm+0x1a/0x30 The problem arises due to the rfkill_block work is not cancelled when wiphy is being unregistered. In order to fix the issue cancel the corresponding work in wiphy_unregister(). Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 1f87f7d3a3b4 ("cfg80211: add rfkill support") Cc: stable@vger.kernel.org Signed-off-by: Daniil Dulov Link: https://patch.msgid.link/20260211082024.1967588-1-d.dulov@aladdin.ru Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index f291af14a6459..a844f5253aa41 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -1104,6 +1104,7 @@ void wiphy_unregister(struct wiphy *wiphy) /* this has nothing to do now but make sure it's gone */ cancel_work_sync(&rdev->wiphy_work); + cancel_work_sync(&rdev->rfkill_block); cancel_work_sync(&rdev->conn_work); flush_work(&rdev->event_work); cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); -- 2.51.0