๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Eric Dumazet Mon, 23 Nov 2026 10:00
Re: [PATCH v1 net] tcp: Don't clear saddr before ->put_port().
#20874
Author: Eric Dumazet
Date: Mon, 23 Nov 2026 10:00
22 lines
9573 bytes
Le sam. 21 nov. 2026 ร  21:35, Kuniyuki Iwashima <kuniyu@google.com> a รฉcrit :
>
> When CGROUP_INET4_POST_BIND or CGROUP_INET6_POST_BIND prog fails,
> __inet_bind() / __inet6_bind() calls sk->sk_prot->put_port().
>
> For TCP, __inet_put_port() calls inet_bhashfn_portaddr() to get
> the corresponding bhash2 bucket.
>
> inet_bhashfn_portaddr() requires saddr, but it is cleared before
> __inet_put_port(), leading to bhash2 lock mismatch.
>
> This triggers list corruption or use-after-free by a conccurent
> thread touching the same bhash2 bucket, e.g. tcp_diag_dump()
> with TCPF_BOUND_INACTIVE. [0]
>
> Let's clear saddr after calling sk->sk_prot->put_port().

Reviewed-by: Eric Dumazet <edumazet@kernel.org>

Thanks!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads