--- zzzz-none-000/linux-4.4.271/net/core/sock.c 2021-06-03 06:22:09.000000000 +0000 +++ maple-fsgw-759/linux-4.4.271/net/core/sock.c 2023-12-20 10:37:40.000000000 +0000 @@ -1477,9 +1477,11 @@ static void __sk_free(struct sock *sk) { +#ifdef CONFIG_SOCK_DIAG if (unlikely(sk->sk_net_refcnt && sock_diag_has_destroy_listeners(sk))) sock_diag_broadcast_destroy(sk); else +#endif sk_destruct(sk); } @@ -1676,6 +1678,11 @@ { skb_orphan(skb); skb->sk = sk; +#ifdef CONFIG_AVM_SK_TC_INDEX +#ifdef CONFIG_NET_SCHED + skb->tc_index = sk->sk_tc_index; +#endif +#endif #ifdef CONFIG_INET if (unlikely(!sk_fullsock(sk))) { skb->destructor = sock_edemux; @@ -2422,8 +2429,11 @@ sk->sk_type = sock->type; sk->sk_wq = sock->wq; sock->sk = sk; - } else + sk->sk_uid = SOCK_INODE(sock)->i_uid; + } else { sk->sk_wq = NULL; + sk->sk_uid = make_kuid(sock_net(sk)->user_ns, 0); + } rwlock_init(&sk->sk_callback_lock); lockdep_set_class_and_name(&sk->sk_callback_lock, @@ -3070,6 +3080,8 @@ static int __init proto_init(void) { + if (IS_ENABLED(CONFIG_PROC_STRIPPED)) + return 0; return register_pernet_subsys(&proto_net_ops); }