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]
Message-ID: <20081017200916.GF20815@postel.suug.ch>
Date:	Fri, 17 Oct 2008 22:09:16 +0200
From:	Thomas Graf <tgraf@...g.ch>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] pkt_sched: Control group classifier

* Andi Kleen <andi@...stfloor.org> 2008-10-17 20:32
> > softirq_count() simply counts the levels of bh disable.
> 
> softirqs always have bh disabled.  So it's always true inside them.
> And you should know what _bh locks you hold.

I actually tried "softirq_count() == SOFTIRQ_OFFSET" to see if the
call is made form user context. It works pretty well because all
callers of dev_queue_xmit() are required to disable bh. Nevertheless
I think it's quite fragile. If a dev_queue_xmit() caller from softirq
does not disable bh explicitely on its own but instead relies on
do_softirq() to have disabled bh already, the softirq count of such
a call may be equal to the one of a user context call to dev_queue_xmit().

I found explicitely counting softirq_enter() to be more reliable
without having much of a performance impact. I'm happy with both
solutions though.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ