aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorKalimochoAz <calimochoazucarado@gmail.com>2012-04-25 09:22:57 +0200
committerKalimochoAz <calimochoazucarado@gmail.com>2012-04-25 09:22:57 +0200
commit7f075f6e53a5e2059f7c70c25db599806021b91f (patch)
tree53aaeb633fb669934093df40e700cb2c503b4e4b /security
parent49862916089b50baf9eab454b1c6b4f2e300268d (diff)
parent41f45f5e60e6db84898b609f7f62ace90f842fdd (diff)
downloadkernel_samsung_crespo-7f075f6e53a5e2059f7c70c25db599806021b91f.zip
kernel_samsung_crespo-7f075f6e53a5e2059f7c70c25db599806021b91f.tar.gz
kernel_samsung_crespo-7f075f6e53a5e2059f7c70c25db599806021b91f.tar.bz2
Merge branch 'linux-3.0.y' into cmremote
Diffstat (limited to 'security')
-rw-r--r--security/commoncap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index 1322b6a..ccfe568 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -28,6 +28,7 @@
#include <linux/prctl.h>
#include <linux/securebits.h>
#include <linux/user_namespace.h>
+#include <linux/personality.h>
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
#include <linux/android_aid.h>
@@ -519,6 +520,11 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
}
skip:
+ /* if we have fs caps, clear dangerous personality flags */
+ if (!cap_issubset(new->cap_permitted, old->cap_permitted))
+ bprm->per_clear |= PER_CLEAR_ON_SETID;
+
+
/* Don't let someone trace a set[ug]id/setpcap binary with the revised
* credentials unless they have the appropriate permit
*/