Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Yuqiang Sun <izaiahsun@gmail.com>
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
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	[thread overview]
Message-ID: <20261126140852.GA31322@horms.kernel.org> (raw)
In-Reply-To: <20261119055731.55798-1-izaiahsun@gmail.com>

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>


      reply	other threads:[~2026-11-26 14:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  5:57 [PATCH iwl-net] ice: Do not free a preallocated node in ice_sched_add_node() Yuqiang Sun
2026-11-26 14:08 ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261126140852.GA31322@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=izaiahsun@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.wilczynski@samsung.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox