Netdev List
 help / color / mirror / Atom feed
From: "Li,Rongqing" <lirongqing@baidu.com>
To: "Ertman, David M" <david.m.ertman@intel.com>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"Kitszel, Przemyslaw" <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>,
	Daniel Machon <daniel.machon@microchip.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: 答复: [????] RE: [PATCH net] ice: Fix uninitialized ndlist in ice_lag_rebuild()
Date: Thu, 3 Dec 2026 02:18:49 +0000	[thread overview]
Message-ID: <c617db10426b486cba5ee60332ffc9f8@baidu.com> (raw)
In-Reply-To: <LVUPR11MB981262EEC6AC4CB3E5C470C5DD4C2@LVUPR11MB9812.namprd11.prod.outlook.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);
> 
> I think a better solution to this issue would be to reduce the scope of ndlist to
> the else block where it is needed and used exclusively.  It can be init'd, used,
> and destroyed within that block.  That way we avoid unnecessary list init or any
> "if" clutter.
> 

Ok, I will send a v2

Thanks

[Li,Rongqing] 



> Thanks,
> DaveE
> 
> > +
> >         mutex_lock(&pf->lag_mutex);
> >
> >         lag = pf->lag;
> > --
> > 2.9.4
> 


      reply	other threads:[~2026-12-03  2:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  8:24 [PATCH net] ice: Fix uninitialized ndlist in ice_lag_rebuild() lirongqing
2026-12-01  8:28 ` netdev-bot+sinfo
2026-12-01  9:56   ` 答复: [外部邮件] " Li,Rongqing
2026-12-02 23:06 ` Ertman, David M
2026-12-03  2:18   ` Li,Rongqing [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=c617db10426b486cba5ee60332ffc9f8@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