On Sat, Feb 21, 2026 at 11:30 PM GMT, Kuniyuki Iwashima wrote:
SOCKMAP memory accounting for UDP is broken for two reasons:
1. sk->sk_forward_alloc must be changed under
spin_lock_bh(&sk->sk_receive_queue.lock)
2. sk_psock_skb_ingress_self() should not be used for UDP
since UDP may reclaim sk->sk_forward_alloc partially
before passing skb to sockmap, resulting in a negative
sk->sk_forward_alloc
This is a prep commit to consolidate sk_psock_skb_ingress_self()
and centralise the fix to sk_psock_skb_ingress().
Let's inline sk_psock_create_ingress_msg().
Note that now alloc_sk_msg() is called first.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
v4: Don't pass gfp_flags and instead change it based on
take_ref in the next patch
---
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>