🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9640

Re: [PATCH net 0/2] devlink: do not dereference a missing param item or shared buffer

#9640
From: Linkui Xiao
Date: Mon, 02 Nov 2026 13:12
54 lines
10801 bytes
Hi Simon,

thanks for the review.

On 2026/11/2 20:05, Simon Horman wrote:
> On Fri, Oct 30, 2026 at 11:33:30AM +0800, Linkui Xiao wrote:
>> From: Linkui Xiao <xiaolinkui@kylinos.cn>
>>
>> Two devlink helpers look an object up by id or index, warn when the
>> lookup fails, and then pass the NULL result to code that dereferences
>> it. A driver mistake (a param_id that was never registered, an sb_index
>> that was never registered or is unregistered twice) therefore costs an
>> oops instead of a warning.
>>
>>    1/2 param: devl_param_value_changed() hands the missing param item to
>>        devlink_param_notify() -> devlink_nl_param_fill(), whose first
>>        statement dereferences param_item->param.
>>
>>    2/2 sb: devl_sb_unregister() runs list_del() on the missing shared
>>        buffer; list is the first member of struct devlink_sb, so it
>>        reads and writes through address 0.
>>
>> In both cases every other user of the same lookup already returns right
>> after the warning, so the fixes just align the remaining callers; there
>> is no change of behavior beyond avoiding the dereference. The param side
>> follows the example Jiri set for devlink_param_unregister():
>>
>> Link: https://lore.kernel.org/all/20230126075838.1643665-5-jiri@resnulli.us/
>>
>> Both Fixes: tags point at the commits that introduced the unguarded
>> WARN_ON pattern; the current devl_() functions are pure renames of those
>> originals. No in-tree caller triggers either path today (the audit is
>> part of a defensive hardening pass), so both are aimed at stopping
>> out-of-tree drivers from turning a driver bug into an oops.
> 
> Thanks, both these fixes look good to me.
> 
> But I do wonder if the hardening aspect, from an in-tree pov,
> makes them net-next rather than net material.
> 
> I say that, because my understanding is that there is some pressure
> to only push critical bug fixes via net. This is because of the recent
> up-tick in bug fixes driven by AI-related activities.

Agreed -- net-next is open now, so I have just resent this as
[PATCH net-next v2 0/2]. Only the prefix and the base changed: the two 
hunks,
the Fixes: tags and the commit messages are the ones you reviewed, and the
Reviewed-by tags from v1 are kept. Neither patch carries a Cc: stable, so
there is nothing to drop with the new target.

Thanks,
Linkui
Technical Details
Message-ID: <84706e2d-5196-4e40-8bf5-122a0c54eada@126.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354690-linux-kernel-netdev=dewy.ru
References: <20261030033332.3685172-1-xiaolinkui@126.com> <20261102120504.GD257209@horms.kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354690-linux-kernel-netdev=dewy.ru
From: xiaolinkui@126.com (Linkui Xiao)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 0/2] devlink: do not dereference a missing param item
 or shared buffer
Date: Mon, 2 Nov 2026 21:12:16 +0800
Organization: Usenet Network
Message-ID: <84706e2d-5196-4e40-8bf5-122a0c54eada@126.com>
References: <20261030033332.3685172-1-xiaolinkui@126.com>
 <20261102120504.GD257209@horms.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2929013"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:A9f82IYKDW+1L+GjlLUXTny1fNg= sha256:/pmywtHjqP+HATVPTWAMWZX4KXz9yZhIue7HUAYqGBw=
	sha1:mN01hlEkGfvVXRw093EwUO9fwhk= sha256:jhULxUYwTgrNBBB10k2CljmMEwtUm6sijp0nRXLyI3s=
Content-Language: en-US
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 5BE75112509; Mon,  2 Nov 2026 16:16:49 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	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=126.com
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 Ps54xvQ4ynmQ;
	Mon,  2 Nov 2026 16:16:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-354690-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=126.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 065B61124E7; Mon,  2 Nov 2026 16:16:37 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 7143E6074F1; Mon,  2 Nov 2026 13:14:16 +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=1793625255;
	b=tBngScQKTn9orsDx3X3z4w7zOzOAhOHJmrTMG3HamBhs5zHVmRqu52ymodG0xl9muPDT
	 z1P0RH/LViVDhUrFhYj5nnB56JM2CF9lLPm0o9G3+TUQAgunni+7yhj+teEdUxk4NtKOq
	 i6PkEr8FJtAJsSbxsASfMZhcmI8p4oSiyEgZpl5vkucJ+ZTVdoD5yiYenJtCQpEUQ01ks
	 JeKy/uP9fw4AiuevhEJeJFoshZZTDSCvkrCEBNAQHoH4/JcHwPydO4JMYOMkipH+FLV3z
	 skwhz8J8RypWMnRR5TK3smNnq7mRlT4h/UTgRzJFZ15kQJfndvNksC9L8vqT5lMMaAQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793625255;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:X-CM-TRANSID:
	 X-Coremail-Antispam:X-CM-SenderInfo;
	bh=41dy1SCR9ow3o2u84XXqAsUssaXOxzkkqJ2165MoOgg=;
	b=XvLeR3Qoi/G2jeLtJcfns1uj9MM6evrh1PqnZ5wx8UU1zZFZ/V8HHJWPehjlgnSmoGF4
	 1au/v/A7tyfUj5yDdFOj+5rhAsKMZHIRJcdMGIS4kVi9WemtuXcMVDXsPRJegpOFpSgPp
	 3buPbRWQmrLw/FHoZtZI+F84NGGgUAY10Q+8W3BYFpuvJWBGlnm8zKAK2jK6+PqapVjAY
	 6MRgsqjV1N1jwrx+Vh0+PYzFAWoCLFDBDcKe2ecHrFBwgXnHE1oUlnhkUyt6eg6XaF2og
	 YfIps95OyF/PcOfh9vJbWlYK/jcxLHKQ22KHoV3dRX0zK7OzcrxkrSrBFRK2fAnmplQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=oXeBP6HL;
	dmarc=pass header.from=126.com;
	spf=pass smtp.mailfrom=126.com;
	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 95150606A32C;
	Mon,  2 Nov 2026 13:14:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=oXeBP6HL
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.7
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793625230;
	b=wnmbSpKHZZSw69wlTDvYTATMskHzJVE1sQx8XC7pClNwxqkf+Rk22YW2FanCI2atIYBR
	 ZsIFXC6lBG52m2xomnNXh1+uRi0SBLMM5KwX3ZDkGw1AQV18mxxCB9I6IN9oijIXCOvkF
	 FJOpmzxKnbcmfe6BaXRdleF71VkKs1QQOK2zQwnGlbJF/QNKdTE4Qf2mU9uvQsj4QBSkI
	 zMSgcfyiLvOYdW7FwmPzmXOf4dR4hcHnXB5Ye4t3HD3+0w0Az4JyoQL0D19Qx1thS3eR/
	 M7dKOdo96XdsV7NRsxONGdVPzmI2d4KWADoPmHtowMGjje5mUkedy/QsovsGCBAs6EQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793625230;
	h=DMARC-Filter:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:X-CM-TRANSID:
	 X-Coremail-Antispam:X-CM-SenderInfo;
	bh=41dy1SCR9ow3o2u84XXqAsUssaXOxzkkqJ2165MoOgg=;
	b=UEyXmRv4tmz8CE7VQwbugNlMbCS/1D1qZhfxyaTqdPsV+BmWc+5r3Ve56WvllkufqvAN
	 Rgm/rYp+XfJmrpAq6UJy0dM8OTq62xGUQucmUnKTQPoQEvp+ApvIznyFhQ4TBAm3dQLCi
	 xpV7Dix9xuLNK/fM6lKb3IL/Dnylb7ARuhFxxFdze+gqdwjOQegvUA6aDzUdHzON8hO87
	 JusCrxGF4pJzVciEDlLqJIF1+giuyzfE5u5kDl4mQzg6DxfvjiA9ZVKHMhl8hvLYmu1fZ
	 VYycjZPq4JqU41jP6bx1D6+qe2+GDblRRMu2T9ekxk7mE15B76k28Cz2cHR4JwX4Geg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=126.com;
	spf=pass smtp.mailfrom=126.com;
	dkim=pass header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=oXeBP6HL;
	arc=none smtp.remote-ip=117.135.210.7
X-Received: from m16.mail.126.com (m16.mail.126.com [117.135.210.7])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70EC9606A329;
	Mon,  2 Nov 2026 13:13:46 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70EC9606A329
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com;
	s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From:
	Content-Type; bh=41dy1SCR9ow3o2u84XXqAsUssaXOxzkkqJ2165MoOgg=;
	b=oXeBP6HLpLLG5TH9BQ1tYP5ufiUrobOL1J9mcjjTkA7SZZRRj8eQu96WMv6VgK
	G/KeBgzvqPwCNFH1Rk7JLFGjEOUZjFr+3vyEQoQRjf954GDfYNOWLZ8VzIMt9x4V
	oNbsbsSmgnHJZmGcU9+QtyQWqYD3ZJMsf+OBiBRoiXNM4=
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-User-Agent: Mozilla Thunderbird
X-Cc: jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org, Linkui Xiao <xiaolinkui@kylinos.cn>
X-In-Reply-To: <20261102120504.GD257209@horms.kernel.org>
X-CM-TRANSID: _____wD3nx4wjOhqr75HCg--.4115S2
X-Coremail-Antispam: 1Uf129KBjvJXoW7uFyUXr1UtryUKFWfXw4fKrg_yoW8Kry7pa
	y3tFn5tr1DJrW0vr4kZa18XFy0k3W8G345Kryrta4rZa9xCryftr43Kw4FvF1UCr4fW34U
	tw1av3WruF4DAFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UZtxDUUUUU=
X-CM-SenderInfo: p0ld0z5lqn3xa6rslhhfrp/xtbBlRQF22rojDRMHAAA31