On Thu, Jul 20, 2023 at 11:17 PM Kuniyuki Iwashima kuniyu@amazon.com wrote:
Fix the problem by rejecting unhashed sockets in bpf_sk_assign(). This matches the behaviour of __inet_lookup_skb which is ultimately the goal of bpf_sk_assign().
Fixes: cf7fbe660f2d ("bpf: Add socket assign support")
Should this be 0c48eefae712 then ?
I think it makes sense to target it at the original helper add, since we really should've done the unhashed check back then. Relying on unhashed not being available is too subtle.