Patchwork [3.5.y.z,extended,stable] Patch "selinux: use GFP_ATOMIC under spin_lock" has been added to staging queue

mail settings
Submitter Luis Henriques
Date March 20, 2013, 10:43 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/229328/
State New
Headers show


Luis Henriques - March 20, 2013, 10:43 a.m.
This is a note to let you know that I have just added a patch titled

    selinux: use GFP_ATOMIC under spin_lock

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 983ae9f8fe2ac2e1d6dfd28ca36a9eaf4959c069 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <>
Date: Sat, 16 Mar 2013 12:48:11 +0300
Subject: [PATCH] selinux: use GFP_ATOMIC under spin_lock

commit 4502403dcf8f5c76abd4dbab8726c8e4ecb5cd34 upstream.

The call tree here is:

sk_clone_lock()              <- takes bh_lock_sock(newsk);
clone_policy()               <- uses GFP_ATOMIC for allocations

Signed-off-by: Dan Carpenter <>
Signed-off-by: James Morris <>
Luis Henriques <>
 security/selinux/xfrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c
index 48665ec..8ab2951 100644
--- a/security/selinux/xfrm.c
+++ b/security/selinux/xfrm.c
@@ -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;