RE: [EXTERNAL] Re: [PATCH net] net: core: Fix the loop in default_device_exit_net()

From: Haiyang Zhang
Date: Tue Jul 22 2025 - 12:16:06 EST




> -----Original Message-----
> From: Eric Dumazet <edumazet@xxxxxxxxxx>
> Sent: Tuesday, July 22, 2025 2:52 AM
> To: Haiyang Zhang <haiyangz@xxxxxxxxxxxxxxxxxxx>
> Cc: linux-hyperv@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; Haiyang Zhang
> <haiyangz@xxxxxxxxxxxxx>; KY Srinivasan <kys@xxxxxxxxxxxxx>;
> wei.liu@xxxxxxxxxx; kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx; horms@xxxxxxxxxx;
> davem@xxxxxxxxxxxxx; sdf@xxxxxxxxxxx; kuniyu@xxxxxxxxxx;
> ahmed.zaki@xxxxxxxxx; aleksander.lobakin@xxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; stable@xxxxxxxxxxxxxxx; #@linux.microsoft.com;
> 5.4+@xxxxxxxxxxxxxxxxxxx
> Subject: [EXTERNAL] Re: [PATCH net] net: core: Fix the loop in
> default_device_exit_net()
>
> On Fri, Jul 18, 2025 at 1:21 PM Haiyang Zhang
> <haiyangz@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > From: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
> >
> > The loop in default_device_exit_net() won't be able to properly detect
> the
> > head then stop, and will hit NULL pointer, when a driver, like
> hv_netvsc,
> > automatically moves the slave device together with the master device.
> >
> > To fix this, add a helper function to return the first migratable netdev
> > correctly, no matter one or two devices were removed from this net's
> list
> > in the last iteration.
> >
> > Cc: stable@xxxxxxxxxxxxxxx # 5.4+
>
> We (network maintainers) prefer a Fixes: tag, so that we can look at
> the blamed patch, rather than trusting your '5.4' hint.
>
> Without a Fixes tag, you are forcing each reviewer to do the
> archeology work, and possibly completely miss your point.

Thanks. I will have the Fixes tag in the new patch.

- Haiyang