Re: [PATCH v5.10.y] bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself
From: Greg KH
Date: Thu Jan 08 2026 - 11:14:17 EST
On Fri, Dec 12, 2025 at 03:54:58AM +0000, HarinadhD wrote:
> From: Jakub Sitnicki <jakub@xxxxxxxxxxxxxx>
>
> [ Upstream commit 5b4a79ba65a1ab479903fff2e604865d229b70a9 ]
>
> sock_map proto callbacks should never call themselves by design. Protect
> against bugs like [1] and break out of the recursive loop to avoid a stack
> overflow in favor of a resource leak.
>
> [1] https://lore.kernel.org/all/00000000000073b14905ef2e7401@xxxxxxxxxx/
>
> Suggested-by: Eric Dumazet <edumazet@xxxxxxxxxx>
> Signed-off-by: Jakub Sitnicki <jakub@xxxxxxxxxxxxxx>
> Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>
> Link: https://lore.kernel.org/r/20230113-sockmap-fix-v2-1-1e0ee7ac2f90@xxxxxxxxxxxxxx
> Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> [ Harinadh: Modified to apply on v5.10.y ]
> Signed-off-by: HarinadhD <Harinadh.Dommaraju@xxxxxxxxxxxx>
Please use your name for your signed-off-by.
thanks,
greg k-h