summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/proc/base.c4
-rw-r--r--net/ipv4/af_inet.c3
-rw-r--r--net/ipv6/af_inet6.c3
-rw-r--r--security/commoncap.c4
4 files changed, 8 insertions, 6 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 2d00fdde934..8051324d187 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1013,7 +1013,7 @@ static int oom_adjust_permission(struct inode *inode, int mask)
p = get_proc_task(inode);
if(p) {
- uid = task_uid(p);
+ uid = __kuid_val(task_uid(p));
put_task_struct(p);
}
@@ -1021,7 +1021,7 @@ static int oom_adjust_permission(struct inode *inode, int mask)
* System Server (uid == 1000) is granted access to oom_adj of all
* android applications (uid > 10000) as and services (uid >= 1000)
*/
- if (p && (current_fsuid() == 1000) && (uid >= 1000)) {
+ if (p && (__kuid_val(current_fsuid()) == 1000) && (uid >= 1000)) {
if (inode->i_mode >> 6 & mask) {
return 0;
}
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 109017e8226..19edfcdaf3e 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -124,7 +124,8 @@
static inline int current_has_network(void)
{
- return in_egroup_p(AID_INET) || capable(CAP_NET_RAW);
+ return in_egroup_p(KGIDT_INIT(AID_INET)) ||
+ capable(CAP_NET_RAW);
}
#else
static inline int current_has_network(void)
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index a4cfde67fcb..f0081f9cc84 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -68,7 +68,8 @@
static inline int current_has_network(void)
{
- return in_egroup_p(AID_INET) || capable(CAP_NET_RAW);
+ return in_egroup_p(KGIDT_INIT(AID_INET)) ||
+ capable(CAP_NET_RAW);
}
#else
static inline int current_has_network(void)
diff --git a/security/commoncap.c b/security/commoncap.c
index 5870fdc224b..205921a9748 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -83,9 +83,9 @@ int cap_capable(const struct cred *cred, struct user_namespace *targ_ns,
struct user_namespace *ns = targ_ns;
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
- if (cap == CAP_NET_RAW && in_egroup_p(AID_NET_RAW))
+ if (cap == CAP_NET_RAW && in_egroup_p(KGIDT_INIT(AID_NET_RAW)))
return 0;
- if (cap == CAP_NET_ADMIN && in_egroup_p(AID_NET_ADMIN))
+ if (cap == CAP_NET_ADMIN && in_egroup_p(KGIDT_INIT(AID_NET_ADMIN)))
return 0;
#endif