From: lirongqing <lirongqing@baidu.com>
To: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Dave Ertman <david.m.ertman@intel.com>,
Daniel Machon <daniel.machon@microchip.com>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>
Cc: Li RongQing <lirongqing@baidu.com>
Subject: [PATCH net] ice: Fix uninitialized ndlist in ice_lag_rebuild()
Date: Tue, 1 Dec 2026 16:24:02 +0800 [thread overview]
Message-ID: <20261201082402.2986-1-lirongqing@baidu.com> (raw)
From: Li RongQing <lirongqing@baidu.com>
ice_lag_rebuild() only populates ndlist when the local interface is not
the primary interface of the aggregate, yet it unconditionally passes
ndlist to ice_lag_destroy_netdev_list() on exit. When rebuilding on a
primary interface, ndlist.node remains uninitialized, causing the cleanup
path to traverse garbage stack memory and pass invalid pointers to kfree().
Initialize ndlist.node prior to acquiring lag_mutex and checking the
primary interface status so the cleanup path always operates on a valid
list head.
Fixes: 3579aa86fb40 ("ice: update reset path for SRIOV LAG support")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
drivers/net/ethernet/intel/ice/ice_lag.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 08a17de..18b11ef 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -2706,6 +2706,8 @@ void ice_lag_rebuild(struct ice_pf *pf)
if (!pf->lag || !pf->lag->bonded)
return;
+ INIT_LIST_HEAD(&ndlist.node);
+
mutex_lock(&pf->lag_mutex);
lag = pf->lag;
--
2.9.4
next reply other threads:[~2026-12-01 8:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 8:24 lirongqing [this message]
2026-12-01 8:28 ` [PATCH net] ice: Fix uninitialized ndlist in ice_lag_rebuild() netdev-bot+sinfo
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=20261201082402.2986-1-lirongqing@baidu.com \
--to=lirongqing@baidu.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=david.m.ertman@intel.com \
--cc=edumazet@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/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