diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 6e6ec18fb6d0..0d7e9834d9be 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -606,6 +606,15 @@ static inline void sk_add_bind_node(struct sock *sk, | |||
606 | #define sk_for_each_bound(__sk, node, list) \ | 606 | #define sk_for_each_bound(__sk, node, list) \ |
607 | hlist_for_each_entry(__sk, node, list, sk_bind_node) | 607 | hlist_for_each_entry(__sk, node, list, sk_bind_node) |
608 | 608 | ||
609 | static inline struct user_namespace *sk_user_ns(struct sock *sk) | ||
610 | { | ||
611 | /* Careful only use this in a context where these parameters | ||
612 | * can not change and must all be valid, such as recvmsg from | ||
613 | * userspace. | ||
614 | */ | ||
615 | return sk->sk_socket->file->f_cred->user_ns; | ||
616 | } | ||
617 | |||
609 | /* Sock flags */ | 618 | /* Sock flags */ |
610 | enum sock_flags { | 619 | enum sock_flags { |
611 | SOCK_DEAD, | 620 | SOCK_DEAD, |
@@ -1662,7 +1671,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) | |||
1662 | write_unlock_bh(&sk->sk_callback_lock); | 1671 | write_unlock_bh(&sk->sk_callback_lock); |
1663 | } | 1672 | } |
1664 | 1673 | ||
1665 | extern int sock_i_uid(struct sock *sk); | 1674 | extern kuid_t sock_i_uid(struct sock *sk); |
1666 | extern unsigned long sock_i_ino(struct sock *sk); | 1675 | extern unsigned long sock_i_ino(struct sock *sk); |
1667 | 1676 | ||
1668 | static inline struct dst_entry * | 1677 | static inline struct dst_entry * |