Re: 2.6.10-rc2-mm1 - SELinux atomic_dec_and_test() bug

From: James Morris
Date: Tue Nov 16 2004 - 11:54:35 EST


Atomic underflow debugging in this kernel exposed a bug in the AVC RCU
code, fix below. The effect of this bug would be delayed node
reclamation.

Signed-off-by: James Morris <jmorris@xxxxxxxxxx>

---

diff -purN -X dontdiff linux-2.6.10-rc2-mm1.o/security/selinux/avc.c linux-2.6.10-rc2-mm1.w/security/selinux/avc.c
--- linux-2.6.10-rc2-mm1.o/security/selinux/avc.c 2004-11-16 10:57:16.000000000 -0500
+++ linux-2.6.10-rc2-mm1.w/security/selinux/avc.c 2004-11-16 11:27:19.000000000 -0500
@@ -269,7 +269,7 @@ static inline int avc_reclaim_node(void)
continue;

list_for_each_entry(node, &avc_cache.slots[hvalue], list) {
- if (!atomic_dec_and_test(&node->ae.used)) {
+ if (atomic_dec_and_test(&node->ae.used)) {
/* Recently Unused */
avc_node_delete(node);
avc_cache_stats_incr(reclaims);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/