aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 65c3d62bfa5a..9d43736a869d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -604,6 +604,15 @@ static inline void sk_add_bind_node(struct sock *sk,
604#define sk_for_each_bound(__sk, node, list) \ 604#define sk_for_each_bound(__sk, node, list) \
605 hlist_for_each_entry(__sk, node, list, sk_bind_node) 605 hlist_for_each_entry(__sk, node, list, sk_bind_node)
606 606
607static inline struct user_namespace *sk_user_ns(struct sock *sk)
608{
609 /* Careful only use this in a context where these parameters
610 * can not change and must all be valid, such as recvmsg from
611 * userspace.
612 */
613 return sk->sk_socket->file->f_cred->user_ns;
614}
615
607/* Sock flags */ 616/* Sock flags */
608enum sock_flags { 617enum sock_flags {
609 SOCK_DEAD, 618 SOCK_DEAD,