🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13415

Re: [PATCH] wifi: nl80211: clear wdev before erroring out of station dump

#13415
From: Greg KH
Date: Mon, 09 Nov 2026 20:29
41 lines
9800 bytes
On Sun, Nov 08, 2026 at 09:57:39PM +0000, Noah Weinberger wrote:
> Hello,
> 
> In nl80211_dump_station(), the new -EAGAIN retry path calls
> __nl80211_lock_held_wdev(), which drops the reference we hold and then
> re-looks up the wdev under the wiphy mutex. If the wdev is being
> removed, that lookup returns ERR_PTR(-ENODEV).
> 
> The IS_ERR branch jumps to out_err with 'wdev' still set to the error
> pointer, and out_err then does:
> 
>     else if (wdev)
>             wdev_put(wdev);
> 
> i.e. wdev_put() is called on ERR_PTR(-ENODEV), dereferencing an
> unmapped kernel address (~0xd). The station dump requires no
> capabilities, so any local user can reach the trigger while a
> concurrent interface removal (admin action or unplug) closes the race.
> The result is a kernel oops in the dumping task, or a full panic with
> panic_on_oops.
> 
> The sibling handlers nl80211_get_station() and nl80211_tx_mgmt() never
> put the error pointer; the dump path is the only one that does. Clear
> wdev before jumping to the error label.
> 
> Affected version/commit: mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07), net/wireless/nl80211.c:9023-9035 (EAGAIN path), nl80211.c:296-306 (__nl80211_lock_held_wdev), nl80211.c:9133-9137 (out_err).
> Introduced in the v7.4 merge window (unlocked station-dump rework).
> 
> This was found during an assisted (AI-supported) static source review of
> mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07); every code path cited below was re-verified by the
> reporter against that tree. The patch below has NOT been compiled and has
> NOT been runtime tested, and no reproducer was produced - the triggering
> conditions are described above instead. Please treat this as a report for
> verification rather than a battle-tested fix.
> 
> Fixes: [fill in before sending - on a full clone run:
>   git log -S '__nl80211_lock_held_wdev' --oneline -- net/wireless/nl80211.c]
> Reported-by: [your name and email]

I think you forgot to read the patch your LLM spit out :(
Technical Details
Message-ID: <2026110952-litter-haziness-bc23@gregkh>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359598-linux-kernel-netdev=dewy.ru
References: <ltwfLZuSH-PEFdqMECEU8rHwZCjSL5--7RG-qrW8a-Fwezdgpb1QYiDm-8aCRNIgwY-laqSmHJWAqV4uI092NLEudhWEABdd3B5iGsV4jJ8=@proton.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359598-linux-kernel-netdev=dewy.ru
From: gregkh@linuxfoundation.org (Greg KH)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] wifi: nl80211: clear wdev before erroring out of station
 dump
Date: Mon, 9 Nov 2026 15:29:12 -0500
Organization: Usenet Network
Message-ID: <2026110952-litter-haziness-bc23@gregkh>
References: <ltwfLZuSH-PEFdqMECEU8rHwZCjSL5--7RG-qrW8a-Fwezdgpb1QYiDm-8aCRNIgwY-laqSmHJWAqV4uI092NLEudhWEABdd3B5iGsV4jJ8=@proton.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="444340"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:IWUvQOZ7sXfi6GW8iPgoKzHYECk= sha256:RpPGPYHNTiSfK8gF1Q+pVZeNmqkv18BNXk/FgZE//xk=
	sha1:slELqcqPeOf8tbRW3ADAp0j5JJ8= sha256:Ns4DA0LGje23DBnsN7fxt7fkJNxeNi0wOEd1oW7e8lg=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B8EA8113917; Mon,  9 Nov 2026 23:30:55 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.052
X-Spam-Status: No, score=-3.052 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linuxfoundation.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id SVyk9Ee86ueD;
	Mon,  9 Nov 2026 23:30:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359598-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 44A1B113911; Mon,  9 Nov 2026 23:30:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7F29967EEF; Mon,  9 Nov 2026 20:29:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794256158;
	b=zyedtJD9wsyf0MMypZNquWBjIuQgdR+xtQ3w9IZDQOZBqFJzz0HpGBnc2xBw43E5Plpi
	 zhhtCjExP8ZQT8gY9UEEegil1PULX5UpK9dx8qZrFkckkzk3w9mnyNNZ1qzGLJ69naY4B
	 qusIFEVd/8YOU/klXY+GyevBuwZTMVr6MDjbDnNa2RiKAdFckj0oGHFU0cepHcRU2fAQX
	 BLhwVhRec9iFwPBYPGNuZpWCULqVeQPlHp8SYwH1KfoNHQPgFaT8wu2uDMXiRULUDhoP4
	 yukuXeGsArBhwiXjCN+KOMLwax3Oxnzxp1Wh/9TYzxQvDEEHeH/vWRPVP4wvdxEeJkw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794256158;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=RJXpVdEQQ4k4fP/MJ0YE0BzV6lM556s8EF58JGKSn74=;
	b=yN2HqmmmG9EE9BfUrpQmOaRllkALffbjdux8PPWIErDcu/ylaXkk2BwhdTL0CDCrMUBS
	 Q3ZkihU+inQj0GO41PRgErS67CqNIutRJcDJk4pgs6KcRegYsdsh0Yz7j/Lzs1rfLiF+y
	 TTTmmVPaK4KKiLnylsIdOfGT8nLy+92S1wSQ6PbNkltXu50RPWySyTJRQKR4BMCU1mQ/2
	 0f7wGEBXxf552QCYIou03Tk+s2H4Hwzb2oNxwF/J1pKO3L43k3nR7vgJ0sC4I45WHQBl3
	 /8Pi7rKj7dRlDoPgB1+18hyhXPkwxFNUEDNPEjKF8AqTNMHS/XYAzE4YHZZNyOkI+8w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jPtiJpkU;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 43417606A332;
	Mon,  9 Nov 2026 20:29:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jPtiJpkU
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794256157;
	b=QAPtLoHXXbGpSovuNBrOPxGQhi+3WsTKh+glf904TWEgcn4X1YN3YVoP8ctXELOxlYe7
	 Ckx9rOUsZzFF7yq33lR6AtgLTYTh3/ckWvi4sgRWi0VPd+DAwyQjE8qwpzROZyLyYqt5O
	 TUt58DSOB1vW3zsuhQc+eF/kFu3UiypHJuOidxngbf+iYYUCmpk7WkhbUWQ5rWgYaMrps
	 LyHggQH/Q/e6X3khp1cUN58RA0QmWDdyybCgLjeVrZ6WYSvpBfmA77mMUNYQrrNCItww9
	 HXaIs42TIFupxN6F5MYV7r5V4O/yDcTyDis/ehG6DLpB7H+mlARTgCEf5au3XSva1Xw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794256157;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=RJXpVdEQQ4k4fP/MJ0YE0BzV6lM556s8EF58JGKSn74=;
	b=bPnj72VMuI9T2KoA5kXo0qEL3uGOq+RZ4ICEO4UeirfRMDPnr7kWk76wLiDoUlVA0HaR
	 /iuT5YeAFMxDuUda8GjO9JdR7F0ge2uAPLOrVbtRd/AasKgbB+1HAOcbdH9ig2UiTEYDe
	 PequDu+0qK6qMh6Mby8CoYc+zyJfQaTkBk3a1Wd5rgVwWOaBTRrg9Df8B+C0rkhY5Mh3M
	 sDp6xiz4f887LUHZaswbt52bxH45Zx5yjLettQc1w2FVyMlcARS4UsZlR2feiO9RBPinl
	 kKBjt9/xbxVh/8wcM6SgviWNwbJaMxGh0dleNLU5dSmZJx6a0NVx3cw7mYShb8tMO1A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jPtiJpkU;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 042E6606A333;
	Mon,  9 Nov 2026 20:29:16 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 384B21F0089F;
	Mon,  9 Nov 2026 20:29:16 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org;
	s=korg; t=1794256156;
	bh=RJXpVdEQQ4k4fP/MJ0YE0BzV6lM556s8EF58JGKSn74=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=jPtiJpkUnwmbTrw3uDWTqdZKfAzJA7qCw2SsFjA+wc5UpvWwtFwVOz5JbGNu0cBon
	 +pmCRCzP9IbGRqlxuZ3pl8N2b09yw0a8fV9eDAYaRR56XdvQjqVCSwTtLwHkltDfF5
	 cJUtwjSkjKnAgWbG8msbkf592oo0XvK6Tq1MCjro=
X-Cc: "johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"security@kernel.org" <security@kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <ltwfLZuSH-PEFdqMECEU8rHwZCjSL5--7RG-qrW8a-Fwezdgpb1QYiDm-8aCRNIgwY-laqSmHJWAqV4uI092NLEudhWEABdd3B5iGsV4jJ8=@proton.me>