Skip to content

Commit

Permalink
ANDROID: Don't show empty tag stats for unprivileged uids
Browse files Browse the repository at this point in the history
BUG: 27577101
BUG: 27532522
Change-Id: I890831a72e5ad4485fdf30e51a146712b18052ed
Signed-off-by: Mohamad Ayyash <mkayyash@google.com
(cherry picked from commit d188f4810b4479f9bf293c335dbdcbeb4e9e4b4a)
Signed-off-by: Stephen Barber <smbarber@chromium.org>
  • Loading branch information
Mohamad Ayyash authored and Stephen Barber committed May 27, 2016
1 parent f10e741 commit 35d57db
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/netfilter/xt_qtaguid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,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,
Expand Down Expand Up @@ -2547,8 +2547,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",
Expand Down

0 comments on commit 35d57db

Please sign in to comment.