Article View: linux.kernel.netdev
Article #10273Re: [PATCH net 0/2] devlink: do not dereference a missing param item or shared buffer
From: Simon Horman
Date: Tue, 03 Nov 2026 10:46
Date: Tue, 03 Nov 2026 10:46
54 lines
10288 bytes
10288 bytes
On Mon, Nov 02, 2026 at 09:12:16PM +0800, Linkui Xiao wrote: > 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, much appreciated.
Technical Details
Message-ID:
<20261103104621.GD865646@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355483-linux-kernel-netdev=dewy.ruReferences:
<20261030033332.3685172-1-xiaolinkui@126.com> <20261102120504.GD257209@horms.kernel.org> <84706e2d-5196-4e40-8bf5-122a0c54eada@126.com>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-355483-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 0/2] devlink: do not dereference a missing param item or shared buffer Date: Tue, 3 Nov 2026 10:46:21 +0000 Organization: Usenet Network Message-ID: <20261103104621.GD865646@horms.kernel.org> References: <20261030033332.3685172-1-xiaolinkui@126.com> <20261102120504.GD257209@horms.kernel.org> <84706e2d-5196-4e40-8bf5-122a0c54eada@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3154280"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:DXK4+6w/ErHjsti9nkJ8xSqGMmY= sha256:1scLYo/ChDuzmw3KThOAB2PdcWbUVBqggtvLJDnGVKk= sha1:nXS6hEZJOSMasfVAof3zl9iO9h0= sha256:BPvj0M+uekoe3MShhk5HLf7YaBwDPqs1ZC+ZDlGIWVo= 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 BF154112831; Tue, 3 Nov 2026 14:31:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 (2048-bit key) header.d=kernel.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 aPP8fj4ndgMR; Tue, 3 Nov 2026 14:31:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-355483-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 86B5F11281C; Tue, 3 Nov 2026 14:31:16 +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 77BA960C3A8; Tue, 3 Nov 2026 10:58:36 +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=1793702797; b=a9H1/Bmour5VldkZN9Zp0jBqjCGuF5imLy8Ii4ElBaASAXGnviUEpzCk0/mHxijS4BZO lwRxHheqfagbjCPv0qByeWomNvIgzx8eNlAaHfje1jw4Mt1iHRY03ZkGKg9hvdekrEnDv yno+3jXE0MtqTPB3lOWlKVdJtD97aQyR5bFZnk4dAXfyTF8a0aWz0MTP7M0QACEgk7yWs qh+qK2MYBiQy/sa9PqhagJLW/4733agpzllARBBGBPuDp493AZl/gZtYZsG15w0/ROYpP 2TVOTfay12tAXPlOg5+nNNuwlWhKGd+uqY1p8PCOAZAOayR0CUdhxRCPmN7afG/WH6A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793702797; 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=1G2PsQcnNgl4KmAucIRxC3xX4zfowwgWE94gTqwm+b8=; b=A5MGOJhW7eigEwz0r47x03j9beq31zOM+8hmHRl1M9RVWHrtCk7XMvOv2DOvJIe/8CPU jk0PtbbsTUJYx5kC6+iimHRFnS2lLezWaKnLvgEJYdYOgfQVutb35q512OWQ/XSTg5+1Z 3Km+mUtXlraWlf6YIJUJljV3cgi53mt3tOsYy8D175RE6GahiL3wPTL9n4CtTtNycdFth c6Z4gfTkAWTN+72+a1ZkD31o93c5SxD1ko1+wMZP0/s8hqNtlisTWd+cRz91yFhRr2Ilj kTwZtY0x7v0ujZLkC4/KQVj5mpfw0Ioup6KR+QMkP7rx7ETiJIdwARW5Uurh8JosSOw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUgHXZXd; 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 3E2956072C8B; Tue, 3 Nov 2026 10:46:37 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUgHXZXd 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=1793702786; b=3kDnxpDLvgV6v6FUmYWN3D9TTVbLGXg1SijPQ4f8Z4/EX2WwXgHebRZeYRLu0WDHsqNI DCcGQt4uZ2tc79NTfxh3QmUVP6GZSNWqwav+TTVWjwnf8HDTVusVn3p2+uSuFDM5uLOGs nVfJCBoyqyx73YxodhodR9Src5xIkypEKy83eWLFZgy17mv4+/+41mEZHjRTX0Z+E+hAY DdtcgNoHpEC0Gi9RO0JlzBU23+gG/Ml7nfYHWDIsl0w7Ro8tBpm4+sizefsDMBM/6JZw8 kffyjdEphxiKYze92f0Awxb1CkcRjQcWjTO/7PmMqvJ8DJTA0qj5Gh16253gT2IwrTg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793702786; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=1G2PsQcnNgl4KmAucIRxC3xX4zfowwgWE94gTqwm+b8=; b=txKqK1XvmCBlbv0KDjsb39toUeBxVxdSUbaayv4cKZuuvsvbqMgh0rUUYAY+i6xddwgm mm4/ICSWAFvFP3mMI6B8yg6kM4obkyENa/jY7xv4WbOvzPws1QgwjexJIt3CssYUFD4BJ 6vqyVTB9wsC58opQrcFowU2GF7blASU402lYUxJ4afHlkTrfr0NVNvBeRlwlRI6SgsiGO C4Bb/Y5MXdmvho2eNW44Q3B11HY+2ow893NyJlwbTU0RbrJ58jp++Bpn8SWsmbT+jqoj5 89gR+AZl0jwSF0fPvDQuzlrg0L2R+O8I0x5AGV4tEeOCCMR6SvsM5zpZwuHANq2lGqw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUgHXZXd; 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 1C660606C5AE; Tue, 3 Nov 2026 10:46:25 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF1961F000C1; Tue, 3 Nov 2026 10:46:23 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793702785; bh=1G2PsQcnNgl4KmAucIRxC3xX4zfowwgWE94gTqwm+b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FUgHXZXdEYALJR8aUoYGIaet3qMZH7hTArHG4Ubz3xnuONCWv7aVi+fFYbEYLKyQX Kr+aEnenkLGKEtt0YVYOMOgiK/p26c9PmHFHk6ipiBXIPuSRsLlvlWYkf14jDFrJGg kvyiAWEftWgFhTYofTrfpgoYcP3Z/Lo4PrEizo4TUfvmn+O3cVKZMvxH2BCmsBU6Q0 4Eqw0taZVO5J+xmnoZ64jFKPu3PdSthWc2KcL37AOyo3diXs4SFySIGivEIyGgM58f gEJ0lsFdoWRZjhfuBelRstfn2/EKuC5zL+a8cYMbuNTTjME4wa148Ro6qSIsyqwaaP CbyEtaX2VBHfA== 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-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: <84706e2d-5196-4e40-8bf5-122a0c54eada@126.com>