--- zzzz-none-000/linux-4.4.271/include/net/sock.h 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/include/net/sock.h 2023-04-19 10:22:30.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; @@ -356,6 +359,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; /* @@ -429,6 +436,7 @@ #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) __u32 sk_cgrp_prioidx; #endif + kuid_t sk_uid; struct pid *sk_peer_pid; const struct cred *sk_peer_cred; long sk_rcvtimeo; @@ -1712,6 +1720,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); } @@ -1719,6 +1728,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();