summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorPreetham Chandru <pchandru@nvidia.com>2012-04-18 19:27:16 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-04-18 23:37:06 -0700
commitf8582a506c2f2880f5c3cac4da9319e545635c9d (patch)
tree43958423d0a0f7a3a82625746406ca86d21dd5ff /security
parent79972f9677dd651fdeaf7b343a905b20e731f31f (diff)
security: Add config flag for Android specific caps
Add CONFIG_ANDROID_PARANOID_NETWORK for Android specific capabilities Change-Id: Ic9a44e4f754445fbf59a52e5aa75a2d8e3d0930f Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Reviewed-on: http://git-master/r/97519 Reviewed-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-by: Kiran Adduri <kadduri@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'security')
-rw-r--r--security/commoncap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index 5cbb55ec6e43..2b07d91e9e46 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -79,11 +79,12 @@ int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
int cap, int audit)
{
+#ifdef CONFIG_ANDROID_PARANOID_NETWORK
if (cap == CAP_NET_RAW && in_egroup_p(AID_NET_RAW))
return 0;
if (cap == CAP_NET_ADMIN && in_egroup_p(AID_NET_ADMIN))
return 0;
-
+#endif
for (;;) {
/* The creator of the user namespace has all caps. */
if (targ_ns != &init_user_ns && targ_ns->creator == cred->user)