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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Apr 2021 17:28:15 +0200
From:   Eric Dumazet <edumazet@...gle.com>
To:     Paolo Abeni <pabeni@...hat.com>
Cc:     netdev <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, Wei Wang <weiwan@...gle.com>
Subject: Re: [PATCH net v2] net: fix hangup on napi_disable for threaded napi

On Fri, Apr 9, 2021 at 5:25 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> napi_disable() is subject to an hangup, when the threaded
> mode is enabled and the napi is under heavy traffic.
>
> If the relevant napi has been scheduled and the napi_disable()
> kicks in before the next napi_threaded_wait() completes - so
> that the latter quits due to the napi_disable_pending() condition,
> the existing code leaves the NAPI_STATE_SCHED bit set and the
> napi_disable() loop waiting for such bit will hang.
>
> This patch addresses the issue by dropping the NAPI_STATE_DISABLE
> bit test in napi_thread_wait(). The later napi_threaded_poll()
> iteration will take care of clearing the NAPI_STATE_SCHED.
>
> This also addresses a related problem reported by Jakub:
> before this patch a napi_disable()/napi_enable() pair killed
> the napi thread, effectively disabling the threaded mode.
> On the patched kernel napi_disable() simply stops scheduling
> the relevant thread.
>
> v1 -> v2:
>   - let the main napi_thread_poll() loop clear the SCHED bit
>
> Reported-by: Jakub Kicinski <kuba@...nel.org>
> Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support")
> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> ---

Reviewed-by: Eric Dumazet <edumazet@...gle.com>

Thanks !

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ