Article View: linux.kernel.netdev
Article #23093Re: [PATCH iwl-net] ice: Do not free a preallocated node in ice_sched_add_node()
From: Simon Horman
Date: Thu, 26 Nov 2026 14:08
Date: Thu, 26 Nov 2026 14:08
25 lines
8742 bytes
8742 bytes
On Thu, Nov 19, 2026 at 01:57:31PM +0800, Yuqiang Sun wrote:
> ice_devlink_rate_node_new() allocates a scheduler node and stores it in
> the devlink rate as priv. When the parent is set, ice_devlink_set_parent()
> passes it to ice_sched_add_node() as prealloc_node. If allocating
> node->children fails, ice_sched_add_node() frees the node with
> devm_kfree(), but priv still points to it, and later rate operations
> (setting tx_max or tx_share, or setting the parent again) use the freed
> node.
>
> Only free the node when ice_sched_add_node() allocated it.
>
> Fixes: bdf96d965a20 ("ice: Add an option to pre-allocate memory for ice_sched_node")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yuqiang Sun <izaiahsun@gmail.com>
> ---
>
> Notes:
> Bug was found by kbound, an internal static analysis prototype.
> The fix was written with the help of Claude Opus 5.5.
>
> Compile-tested only (x86_64 and arm64 allmodconfig, W=1, sparse): I do
> not have E800 hardware.
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261126140852.GA31322@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372130-linux-kernel-netdev=dewy.ruReferences:
<20261119055731.55798-1-izaiahsun@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372130-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH iwl-net] ice: Do not free a preallocated node in ice_sched_add_node() Date: Thu, 26 Nov 2026 14:08:52 +0000 Organization: Usenet Network Message-ID: <20261126140852.GA31322@horms.kernel.org> References: <20261119055731.55798-1-izaiahsun@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="480973"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:EDYQTA6lO6CH3MA0ehSiXQZY1J8= sha256:SDMOZOl9v4aIAD0ocF4QN8riF2gSGbc3yYiXSE+OMro= sha1:XmEX+JIz/jgNY07BJNaFP+MzPh0= sha256:BNw8XMKoFV09lcfvAck+/O78QD+vwBi6Qq/1ggSnamU= 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 3177E125ED5; Thu, 26 Nov 2026 17:09:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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, 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 uqA47gpJdiHi; Thu, 26 Nov 2026 17:09:14 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372130-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id C5212125EDA; Thu, 26 Nov 2026 17:09:05 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id B90C53648C; Thu, 26 Nov 2026 14:09:01 +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=1795702138; b=Ld7g75IcQCmlhf8GYGfugI74RMSermcw3DgkrJtwqM/irsf1KKNjZqV3Nv+tqqHhsKPj MKVLDsq+ZBOMgcsLjgRPnfsjtVmByyJVDHuwiiArrIxXV9UJz3mEEyYXchn5hrfKtHn37 gr7fYlVDTark+mNuqXEWLm+JFt5JApiW1ULToih13erG4nXjfM7U7/JVFuISTqUvju/qe g9klSqUgglxhIdw1ADSPbL5sFaK+WgFmMNlfy3GbQC4M2W2jP9uYnZRs8VTv0cc+1vog4 NStlMHe6E2ZJomv4VBPmc8lTh+H7XvHcjjvxCjkX9dsSwDC34buZViSnWQcY/cV2mFQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795702138; 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=ycz4zN8OJGHkVYq0dR22YPKKxsW4H2gix6T/uO2MvZc=; b=KtzFw2zzC4sRdRZHi8xDnjsRGWj4IxFbrPCpUGpKBHnHPbj1df9fLj0C32bJVF1dKqVD 9MtLiQUzitPf40SxTWpgf4kUVxE/mOyBOyUuamYT1y55kzULYWrGswW0Lf8MHfpQYAgac us+jTi3OE7czw8RhEOIgI0xCWbs2SBUykeH3TZefl/VZRuCA0g9ST8NZgBH97SL2JCfFE 9K++Q8c3pVIMSq5eTD0XrTg458SFOciAUJcMiqkk7hAUUCwe1Edz1cSDTzEZLGJVAya8U khbCfNpDIpwSXL+lUEa/KClUVRZAsQIGSga/x+P5H/wg0wQWzzrpeJQhq3GFXYiBEiQ== 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=SJOsD03i; 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 D1434606A696; Thu, 26 Nov 2026 14:08:58 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SJOsD03i 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=1795702138; b=oiP+/QTWcqBrfR0w2QYimOT3Wr2mD6lypEPovNjEaLRgM9IOeVuNKTtuvr/vHeH8l5Yp x71Wh517pss11wcdI5accGuBtgGAdyBNbC0tyu1lSFMv3miZfYrN7OxMTqVuVjjDr/Nk4 /FTuulQINzEfdCRYwxiXuBmnKbmAHzq1tyn+lZHobSyoL7ZYNs4T22RqVjiagOKV/w1NH lIC2EsaDYmNgMdcOs69VJaAy8212A4H2w49dPPl/YFNr7PQS4tdEUqZ0GshAyps7fUKq9 9wFtNzugr/RLQ6AlmET+6K+1UQsLg6VBLjIBfcFRosxT3awpLIXSN7frJUhgk0J4kNA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795702138; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=ycz4zN8OJGHkVYq0dR22YPKKxsW4H2gix6T/uO2MvZc=; b=1nK3b9Khxmvb4rKYQmGbfVgVjXGNY7jeZOId0mJvyvKY60bSTLGIBR3mUgpUoHL0R3Ip 7idioKvQFtRqggJqnGO52/7ZG4TAO/O12nXmJ4hO/2R+Y2wbuHUqIDDlCG+gK5ekouk/6 QCQl5HeyL2LzDXvfKQzt6Hn1bGtjXOAlDHkER1jUtS4G7zsCfREZRmpXIqID9j3n7FFry L7l89HlR1Fk4zmQLZ6AdfUy3RGZ871lEfvhdYCc5GrjbqPe5RoD42MH+r+MUdHWMuVBoP Sbh7hOUekUe1aTrA8nPk5K5WnwFjrn4wC2tNHWQYRSiIEpJbL7gHKfRckHN9HyL21EA== 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=SJOsD03i; 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 005CB606A331; Thu, 26 Nov 2026 14:08:57 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 352F91F000C0; Thu, 26 Nov 2026 14:08:55 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795702137; bh=ycz4zN8OJGHkVYq0dR22YPKKxsW4H2gix6T/uO2MvZc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=SJOsD03iiSTrVhmnyD961u/NuqqW5Devu9pnbYz5JxC7dUJP1I0Bqcipy6wgRXLLu EvESMbVecbwkkgAmq2uFk5XFlkofzP/HkwUNRrxxED4BhoiOyemaaaiaum5WfIGB7L CHBkT5dv+GKkLRgKBkO95lxLVXkKN7c+RJqrVQ0uRl+QDeMbpEdgr7mYVNSG9s63x3 t96VMLSPOLUtkLhho7Su00TPCx/1yWJKxS0hlyFN5gysJLkJxJOKazDUuQI6iICGtb jwo970nEJ+jERI24GXm49GO3GCozCvRh6PDX2PRcavUdp2HbuJPdqPzpvoqyMGYqzw 9cio0Kn4Ff3oQ== X-Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, m.wilczynski@samsung.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.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: <20261119055731.55798-1-izaiahsun@gmail.com>