--- zzzz-none-000/linux-4.4.60/include/net/sock.h 2017-04-08 07:53:53.000000000 +0000 +++ hawkeye-5590-729/linux-4.4.60/include/net/sock.h 2022-03-30 14:21:53.000000000 +0000 @@ -241,6 +241,9 @@ u32 skc_tw_snd_nxt; /* struct tcp_timewait_sock */ }; /* public: */ +#ifdef CONFIG_AVM_SK_TC_INDEX + unsigned long skc_tc_index; +#endif }; struct cg_proto; @@ -355,6 +358,10 @@ #define sk_flags __sk_common.skc_flags #define sk_rxhash __sk_common.skc_rxhash +#ifdef CONFIG_AVM_SK_TC_INDEX +#define sk_tc_index __sk_common.skc_tc_index +#endif + socket_lock_t sk_lock; struct sk_buff_head sk_receive_queue; /* @@ -446,6 +453,7 @@ void *sk_security; #endif __u32 sk_mark; + kuid_t sk_uid; #ifdef CONFIG_CGROUP_NET_CLASSID u32 sk_classid; #endif @@ -1691,6 +1699,7 @@ sk->sk_wq = parent->wq; parent->sk = sk; sk_set_socket(sk, parent); + sk->sk_uid = SOCK_INODE(parent)->i_uid; security_sock_graft(sk, parent); write_unlock_bh(&sk->sk_callback_lock); } @@ -1698,6 +1707,11 @@ kuid_t sock_i_uid(struct sock *sk); unsigned long sock_i_ino(struct sock *sk); +static inline kuid_t sock_net_uid(const struct net *net, const struct sock *sk) +{ + return sk ? sk->sk_uid : make_kuid(net->user_ns, 0); +} + static inline u32 net_tx_rndhash(void) { u32 v = prandom_u32();