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:   Mon, 22 Mar 2021 16:09:41 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Maxim Mikityanskiy <maximmi@...dia.com>
Cc:     Jay Vosburgh <j.vosburgh@...il.com>,
        Veaceslav Falico <vfalico@...il.com>,
        Andy Gospodarek <andy@...yhouse.net>,
        Mahesh Bandewar <maheshb@...gle.com>,
        Nikolay Aleksandrov <nikolay@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Tariq Toukan <tariqt@...dia.com>, netdev@...r.kernel.org
Subject: Re: [RFC PATCH net] bonding: Work around lockdep_is_held false
 positives

On Mon, Mar 22, 2021 at 02:38:46PM +0200, Maxim Mikityanskiy wrote:
> After lockdep gets triggered for the first time, it gets disabled, and
> lockdep_enabled() will return false. It will affect lockdep_is_held(),
> which will start returning true all the time. Normally, it just disables
> checks that expect a lock to be held. However, the bonding code checks
> that a lock is NOT held, which triggers a false positive in WARN_ON.
> 
> This commit addresses the issue by replacing lockdep_is_held with
> spin_is_locked, which should have the same effect, but without suffering
> from disabling lockdep.
> 
> Fixes: ee6377147409 ("bonding: Simplify the xmit function for modes that use xmit_hash")
> Signed-off-by: Maxim Mikityanskiy <maximmi@...dia.com>
> Reviewed-by: Tariq Toukan <tariqt@...dia.com>
> ---
> While this patch works around the issue, I would like to discuss better
> options. Another straightforward approach is to extend lockdep API with
> lockdep_is_not_held(), which will be basically !lockdep_is_held() when
> lockdep is enabled, but will return true when !lockdep_enabled().

lockdep_assert_not_held() was added in this cycle to tip: locking/core
https://yhbt.net/lore/all/161475935945.20312.2870945278690244669.tip-bot2@tip-bot2/
https://yhbt.net/lore/all/878s779s9f.fsf@codeaurora.org/

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ