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:   Wed, 18 Nov 2020 08:26:58 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Yunsheng Lin <linyunsheng@...wei.com>, davem@...emloft.net,
        linmiaohe@...wei.com, martin.varghese@...ia.com, pabeni@...hat.com,
        pshelar@....org, fw@...len.de, gnault@...hat.com,
        steffen.klassert@...unet.com, kyk.segfault@...il.com,
        viro@...iv.linux.org.uk, vladimir.oltean@....com,
        edumazet@...gle.com, saeed@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, linuxarm@...wei.com
Subject: Re: [PATCH net-next] net: add in_softirq() debug checking in
 napi_consume_skb()

On Wed, 18 Nov 2020 16:57:57 +0100 Peter Zijlstra wrote:
> On Wed, Nov 18, 2020 at 07:43:48AM -0800, Jakub Kicinski wrote:
> 
> > TBH the last sentence I wrote isn't clear even to me at this point ;D
> > 
> > Maybe using just the macros from preempt.h - like this?
> > 
> > #define lockdep_assert_in_softirq()                                    \
> > do {                                                                   \
> >        WARN_ON_ONCE(__lockdep_enabled                  &&              \
> >                     (!in_softirq() || in_irq() || in_nmi())	\
> > } while (0)
> > 
> > We know what we're doing so in_softirq() should be fine (famous last
> > words).  
> 
> So that's not actually using any lockdep state. But if that's what you
> need, I don't have any real complaints.

Great, thanks! 

The motivation was to piggy back on lockdep rather than adding a
one-off Kconfig knob for a check in the fast path in networking.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ