Skip to content

Commit 80bd490

Browse files
edumazetgregkh
authored andcommitted
sock_map: Add a cond_resched() in sock_hash_free()
[ Upstream commit b1339be ] Several syzbot soft lockup reports all have in common sock_hash_free() If a map with a large number of buckets is destroyed, we need to yield the cpu when needed. Fixes: 75e68e5 ("bpf, sockhash: Synchronize delete from bucket list on map free") Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <martin.lau@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20240906154449.3742932-1-edumazet@google.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7eebbdd commit 80bd490

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/core/sock_map.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ static void sock_hash_free(struct bpf_map *map)
11711171
sock_put(elem->sk);
11721172
sock_hash_free_elem(htab, elem);
11731173
}
1174+
cond_resched();
11741175
}
11751176

11761177
/* wait for psock readers accessing its map link */

0 commit comments

Comments
 (0)