lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHS8izNOCvtuND-4kjX_YPPuTPrFdW+mLghTVMG1zKmjnHmL3Q@mail.gmail.com>
Date: Thu, 6 Feb 2025 16:55:59 -0800
From: Mina Almasry <almasrymina@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com, 
	pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org
Subject: Re: [PATCH net-next v2 4/4] netdevsim: allow normal queue reset while down

On Thu, Feb 6, 2025 at 2:56 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> Resetting queues while the device is down should be legal.
> Allow it, test it. Ideally we'd test this with a real device
> supporting devmem but I don't have access to such devices.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
>  drivers/net/netdevsim/netdev.c           | 10 ++++------
>  tools/testing/selftests/net/nl_netdev.py | 18 +++++++++++++++++-
>  2 files changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
> index 42f247cbdcee..9b394ddc5206 100644
> --- a/drivers/net/netdevsim/netdev.c
> +++ b/drivers/net/netdevsim/netdev.c
> @@ -645,8 +645,11 @@ nsim_queue_mem_alloc(struct net_device *dev, void *per_queue_mem, int idx)
>         if (ns->rq_reset_mode > 3)
>                 return -EINVAL;
>
> -       if (ns->rq_reset_mode == 1)
> +       if (ns->rq_reset_mode == 1) {
> +               if (!netif_running(ns->netdev))
> +                       return -ENETDOWN;

To be honest I could not track down for myself why mode 1 needed to be
excluded as well. AFAICT it should be a similar story to modes 2/3,
i.e. we never initialize the napi on nsim_queue_mem_alloc() for all of
 modes [1, 2, 3] and this particular warning you fixed in patch 3
should again not fire for mode 1 just like they stopped firing for 2 &
3.

But, I'm not sure it's critical to expand the coverage further to mode
1, so FWIW

Reviewed-by: Mina Almasry <almasrymina@...gle.com>


-- 
Thanks,
Mina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ