diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-07-30 16:49:54 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-07-30 16:49:54 -0400 |
commit | f42e88348aa3e9298fc38719202984ebd0e74a66 (patch) | |
tree | 7b2f06d8ed87482fea42ab5927580fd60bcbe260 | |
parent | 6eca0785b084b1d63f55f6e423a543c969c5d1da (diff) | |
download | longterm-queue-2.6.34-f42e88348aa3e9298fc38719202984ebd0e74a66.tar.gz |
security/keys: fix up two compile errors
Two issues. 1) dragging back the kfree_rcu conversion was wrong,
since there is no kfree_rcu until 3.0 and newer, and 2) add in
the obvious missing header fix from upstream for fail #2.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | queue/KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch | 13 | ||||
-rw-r--r-- | queue/security-fix-compile-error-in-commoncap.c.patch | 33 | ||||
-rw-r--r-- | queue/security-rcu-convert-call_rcu-user_update_rcu_dispos.patch | 64 | ||||
-rw-r--r-- | queue/series | 4 |
4 files changed, 42 insertions, 72 deletions
diff --git a/queue/KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch b/queue/KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch index 351eae9..a2f6245 100644 --- a/queue/KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch +++ b/queue/KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch @@ -1,4 +1,4 @@ -From 7deb80439fb5cc91fd1aa211eda9caaaef130312 Mon Sep 17 00:00:00 2001 +From b4ec602f538c3ebd26a918c8413a4e41a8889a82 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Nov 2011 22:09:45 +0000 Subject: [PATCH] KEYS: Fix a NULL pointer deref in the user-defined key type @@ -47,22 +47,23 @@ Acked-by: Neil Horman <nhorman@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> +[PG: pre-3.0 kernels dont have kfree_rcu, so tweak accordingly] Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c -index e4f04d1..9352229 100644 +index e9aa079..d6781b9 100644 --- a/security/keys/user_defined.c +++ b/security/keys/user_defined.c -@@ -105,7 +105,8 @@ int user_update(struct key *key, const void *data, size_t datalen) +@@ -119,7 +119,8 @@ int user_update(struct key *key, const void *data, size_t datalen) key->expiry = 0; } -- kfree_rcu(zap, rcu); +- call_rcu(&zap->rcu, user_update_rcu_disposal); + if (zap) -+ kfree_rcu(zap, rcu); ++ call_rcu(&zap->rcu, user_update_rcu_disposal); error: return ret; -- -1.7.9.7 +1.7.11.1 diff --git a/queue/security-fix-compile-error-in-commoncap.c.patch b/queue/security-fix-compile-error-in-commoncap.c.patch new file mode 100644 index 0000000..077aedd --- /dev/null +++ b/queue/security-fix-compile-error-in-commoncap.c.patch @@ -0,0 +1,33 @@ +From 655a4676085efe94b4ea1d0fd0fbecd587abb88b Mon Sep 17 00:00:00 2001 +From: Jonghwan Choi <jhbird.choi@samsung.com> +Date: Wed, 18 Apr 2012 17:23:04 -0400 +Subject: [PATCH] security: fix compile error in commoncap.c + +commit 51b79bee627d526199b2f6a6bef8ee0c0739b6d1 upstream. + +Add missing "personality.h" +security/commoncap.c: In function 'cap_bprm_set_creds': +security/commoncap.c:510: error: 'PER_CLEAR_ON_SETID' undeclared (first use in this function) +security/commoncap.c:510: error: (Each undeclared identifier is reported only once +security/commoncap.c:510: error: for each function it appears in.) + +Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> +Acked-by: Serge Hallyn <serge.hallyn@canonical.com> +Signed-off-by: James Morris <james.l.morris@oracle.com> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> + +diff --git a/security/commoncap.c b/security/commoncap.c +index a8fc6ec..c325d38 100644 +--- a/security/commoncap.c ++++ b/security/commoncap.c +@@ -28,6 +28,7 @@ + #include <linux/prctl.h> + #include <linux/securebits.h> + #include <linux/syslog.h> ++#include <linux/personality.h> + + /* + * If a non-root user executes a setuid-root binary in +-- +1.7.11.1 + diff --git a/queue/security-rcu-convert-call_rcu-user_update_rcu_dispos.patch b/queue/security-rcu-convert-call_rcu-user_update_rcu_dispos.patch deleted file mode 100644 index 1f99fe1..0000000 --- a/queue/security-rcu-convert-call_rcu-user_update_rcu_dispos.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 5d49b69da20ce0bbf060e091fdbfb06972761a0f Mon Sep 17 00:00:00 2001 -From: Lai Jiangshan <laijs@cn.fujitsu.com> -Date: Fri, 18 Mar 2011 12:11:07 +0800 -Subject: [PATCH] security,rcu: convert call_rcu(user_update_rcu_disposal) to - kfree_rcu() - -commit 3acb458c32293405cf68985b7b3ac5dc0a5e7929 upstream. - -The rcu callback user_update_rcu_disposal() just calls a kfree(), -so we use kfree_rcu() instead of the call_rcu(user_update_rcu_disposal). - -Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> -Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> -Acked-by: David Howells <dhowells@redhat.com> -Reviewed-by: Josh Triplett <josh@joshtriplett.org> -[PG: diffstat slightly different due to comment format differences] -Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> - -diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c -index e9aa079..e4f04d1 100644 ---- a/security/keys/user_defined.c -+++ b/security/keys/user_defined.c -@@ -72,20 +72,6 @@ EXPORT_SYMBOL_GPL(user_instantiate); - - /*****************************************************************************/ - /* -- * dispose of the old data from an updated user defined key -- */ --static void user_update_rcu_disposal(struct rcu_head *rcu) --{ -- struct user_key_payload *upayload; -- -- upayload = container_of(rcu, struct user_key_payload, rcu); -- -- kfree(upayload); -- --} /* end user_update_rcu_disposal() */ -- --/*****************************************************************************/ --/* - * update a user defined key - * - the key's semaphore is write-locked - */ -@@ -119,7 +105,7 @@ int user_update(struct key *key, const void *data, size_t datalen) - key->expiry = 0; - } - -- call_rcu(&zap->rcu, user_update_rcu_disposal); -+ kfree_rcu(zap, rcu); - - error: - return ret; -@@ -154,7 +140,7 @@ void user_revoke(struct key *key) - - if (upayload) { - rcu_assign_pointer(key->payload.data, NULL); -- call_rcu(&upayload->rcu, user_update_rcu_disposal); -+ kfree_rcu(upayload, rcu); - } - - } /* end user_revoke() */ --- -1.7.9.7 - diff --git a/queue/series b/queue/series index 6c0d14c..10ea43f 100644 --- a/queue/series +++ b/queue/series @@ -4,7 +4,6 @@ fs-assign-sb-s_bdi-to-default_backing_dev_info-if-th.patch vm-fix-vm_pgoff-wrap-in-stack-expansion.patch rose-Add-length-checks-to-CALL_REQUEST-parsing.patch drm-integer-overflow-in-drm_mode_dirtyfb_ioctl.patch -fcaps-clear-the-same-personality-flags-as-suid-when-.patch perf-overflow-perf_count_sw_cpu_clock-crashes-recent.patch regset-Prevent-null-pointer-reference-on-readonly-re.patch ext4-fix-undefined-behavior-in-ext4_fill_flex_info.patch @@ -15,5 +14,6 @@ xfs-Fix-possible-memory-corruption-in-xfs_readlink.patch KVM-Remove-ability-to-assign-a-device-without-iommu-.patch KVM-Device-assignment-permission-checks.patch KVM-Ensure-all-vcpus-are-consistent-with-in-kernel-i.patch -security-rcu-convert-call_rcu-user_update_rcu_dispos.patch +security-fix-compile-error-in-commoncap.c.patch +fcaps-clear-the-same-personality-flags-as-suid-when-.patch KEYS-Fix-a-NULL-pointer-deref-in-the-user-defined-ke.patch |