Skip to contentSkip to conversation

selinux: use GFP_ATOMIC under spin_lock

PATCH New Dan Carpenter 1 participant 1 message Mar 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selinux: use GFP_ATOMIC under spin_lock

The call tree here is:

sk_clone_lock() <- takes bh_lock_sock(newsk);
xfrm_sk_clone_policy()
__xfrm_sk_clone_policy()
clone_policy() <- uses GFP_ATOMIC for allocations
security_xfrm_policy_clone()
security_ops->xfrm_policy_clone_security()
selinux_xfrm_policy_clone()

---
Static checker work.

security/selinux/xfrm.c +1 -1
index 48665ec..8ab2951 100644
@@ -310,7 +310,7 @@ int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx,
 
 	if (old_ctx) {
 		new_ctx = kmalloc(sizeof(*old_ctx) + old_ctx->ctx_len,
-				  GFP_KERNEL);
+				  GFP_ATOMIC);
 		if (!new_ctx)
 			return -ENOMEM;