diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-24 03:10:10 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-15 00:48:06 -0400 |
commit | a7cb5a49bf64ba64864ae16a6be028f8b0d3cc06 (patch) | |
tree | 0874310cc4af6cd0193e15058cb9ff9e7a955065 /net/ipv6 | |
parent | adb37c4c67f807f16beb222028fb3ce9a354dc2b (diff) |
userns: Print out socket uids in a user namespace aware fashion.
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/raw.c | 3 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 6 | ||||
-rw-r--r-- | net/ipv6/udp.c | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index ef0579d5bca6..7af88ef01657 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -1251,7 +1251,8 @@ static void raw6_sock_seq_show(struct seq_file *seq, struct sock *sp, int i) | |||
1251 | sk_wmem_alloc_get(sp), | 1251 | sk_wmem_alloc_get(sp), |
1252 | sk_rmem_alloc_get(sp), | 1252 | sk_rmem_alloc_get(sp), |
1253 | 0, 0L, 0, | 1253 | 0, 0L, 0, |
1254 | sock_i_uid(sp), 0, | 1254 | from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)), |
1255 | 0, | ||
1255 | sock_i_ino(sp), | 1256 | sock_i_ino(sp), |
1256 | atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops)); | 1257 | atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops)); |
1257 | } | 1258 | } |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index c66b90f71c9b..4b5b335ebde1 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1803,7 +1803,7 @@ static void tcp_v6_destroy_sock(struct sock *sk) | |||
1803 | #ifdef CONFIG_PROC_FS | 1803 | #ifdef CONFIG_PROC_FS |
1804 | /* Proc filesystem TCPv6 sock list dumping. */ | 1804 | /* Proc filesystem TCPv6 sock list dumping. */ |
1805 | static void get_openreq6(struct seq_file *seq, | 1805 | static void get_openreq6(struct seq_file *seq, |
1806 | const struct sock *sk, struct request_sock *req, int i, int uid) | 1806 | const struct sock *sk, struct request_sock *req, int i, kuid_t uid) |
1807 | { | 1807 | { |
1808 | int ttd = req->expires - jiffies; | 1808 | int ttd = req->expires - jiffies; |
1809 | const struct in6_addr *src = &inet6_rsk(req)->loc_addr; | 1809 | const struct in6_addr *src = &inet6_rsk(req)->loc_addr; |
@@ -1827,7 +1827,7 @@ static void get_openreq6(struct seq_file *seq, | |||
1827 | 1, /* timers active (only the expire timer) */ | 1827 | 1, /* timers active (only the expire timer) */ |
1828 | jiffies_to_clock_t(ttd), | 1828 | jiffies_to_clock_t(ttd), |
1829 | req->retrans, | 1829 | req->retrans, |
1830 | uid, | 1830 | from_kuid_munged(seq_user_ns(seq), uid), |
1831 | 0, /* non standard timer */ | 1831 | 0, /* non standard timer */ |
1832 | 0, /* open_requests have no inode */ | 1832 | 0, /* open_requests have no inode */ |
1833 | 0, req); | 1833 | 0, req); |
@@ -1877,7 +1877,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) | |||
1877 | timer_active, | 1877 | timer_active, |
1878 | jiffies_to_clock_t(timer_expires - jiffies), | 1878 | jiffies_to_clock_t(timer_expires - jiffies), |
1879 | icsk->icsk_retransmits, | 1879 | icsk->icsk_retransmits, |
1880 | sock_i_uid(sp), | 1880 | from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)), |
1881 | icsk->icsk_probes_out, | 1881 | icsk->icsk_probes_out, |
1882 | sock_i_ino(sp), | 1882 | sock_i_ino(sp), |
1883 | atomic_read(&sp->sk_refcnt), sp, | 1883 | atomic_read(&sp->sk_refcnt), sp, |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 99d0077b56b8..bbdff07eebe1 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1458,7 +1458,8 @@ static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket | |||
1458 | sk_wmem_alloc_get(sp), | 1458 | sk_wmem_alloc_get(sp), |
1459 | sk_rmem_alloc_get(sp), | 1459 | sk_rmem_alloc_get(sp), |
1460 | 0, 0L, 0, | 1460 | 0, 0L, 0, |
1461 | sock_i_uid(sp), 0, | 1461 | from_kuid_munged(seq_user_ns(seq), sock_i_uid(sp)), |
1462 | 0, | ||
1462 | sock_i_ino(sp), | 1463 | sock_i_ino(sp), |
1463 | atomic_read(&sp->sk_refcnt), sp, | 1464 | atomic_read(&sp->sk_refcnt), sp, |
1464 | atomic_read(&sp->sk_drops)); | 1465 | atomic_read(&sp->sk_drops)); |