summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMohamad Ayyash <mkayyash@google.com>2016-05-11 13:18:35 -0700
committerHuang, Tao <huangtao@rock-chips.com>2016-09-07 15:45:06 +0800
commita4b64eeadefc3876c25590e613e4561f268666ac (patch)
treeaf650bfc8b87e97b9f1e6335096e5f3e7ad2fd29 /net
parenta1d20be406a7ea5bc226eaa5c866b2e6c95fcd01 (diff)
BACKPORT: Don't show empty tag stats for unprivileged uids
BUG: 27577101 BUG: 27532522 hxw: fix cts com.android.cts.appsecurity.AppSecurityTests#testAppFailAccessPrivateData fail Change-Id: Id6f7933b966ecad0b4d1249ea8ade86b97477545 Signed-off-by: Mohamad Ayyash <mkayyash@google.com> Signed-off-by: HaoXiaowei <hxw@rock-chips.com>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_qtaguid.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c
index e2e7d54f9bb1..3bf0c59dab2f 100644
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
@@ -1946,7 +1946,7 @@ static int qtaguid_ctrl_proc_show(struct seq_file *m, void *v)
);
f_count = atomic_long_read(
&sock_tag_entry->socket->file->f_count);
- seq_printf(m, "sock=%p tag=0x%llx (uid=%u) pid=%u "
+ seq_printf(m, "sock=%pK tag=0x%llx (uid=%u) pid=%u "
"f_count=%lu\n",
sock_tag_entry->sk,
sock_tag_entry->tag, uid,
@@ -2548,8 +2548,7 @@ static int pp_stats_line(struct seq_file *m, struct tag_stat *ts_entry,
uid_t stat_uid = get_uid_from_tag(tag);
struct proc_print_info *ppi = m->private;
/* Detailed tags are not available to everybody */
- if (get_atag_from_tag(tag) && !can_read_other_uid_stats(
- make_kuid(&init_user_ns,stat_uid))) {
+ if (!can_read_other_uid_stats(make_kuid(&init_user_ns,stat_uid))) {
CT_DEBUG("qtaguid: stats line: "
"%s 0x%llx %u: insufficient priv "
"from pid=%u tgid=%u uid=%u stats.gid=%u\n",