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-next>] [day] [month] [year] [list]
Date:	Wed, 29 Dec 2010 15:27:38 -0500
From:	Justin Seyster <jrseys@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: Question about in_interrupt() semantics with regard to softirqs.

I'm trying to understand the in_interrupt() function, and it seems
that it will return true for normal, non-interrupt code that disables
bottom half processing.  It looks like that behavior is intentional,
but I don't understand why it's designed that way.  I'm sorry if I'm
stating something obvious here; it would help me a lot if somebody
double checked my reasoning!

in_interrupt() checks a hardirq count and a softirq count, but I found
out that these two counts behave very differently.  The hardirq count
tracks the nesting depth of hardware interrupts (which is what I would
expect), but the softirq count behaves like the preempt count,
tracking whether softirqs are currently enabled.

So if normal code (executing on behalf of a user process) disables
softirqs with local_bh_disable(), it will get a true return value from
in_interrupt() until it finally reenables them.  But disabling
hardirqs will not have the same effect: the hardirq count is
unchanged, and in_interrupt() will still return false.

My question is: is there a design decision for this asymmetry between
hard and softirqs?  Also, is there a function that does what I really
wanted, which is to return true iff execution is actually in
bottom-half context?  Thanks!
        --Justin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ