Skip to content

Commit b1339be

Browse files
edumazetborkmann
authored andcommitted
sock_map: Add a cond_resched() in sock_hash_free()
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 <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Acked-by: John Fastabend <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent fdfd9d8 commit b1339be

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
@@ -1183,6 +1183,7 @@ static void sock_hash_free(struct bpf_map *map)
11831183
sock_put(elem->sk);
11841184
sock_hash_free_elem(htab, elem);
11851185
}
1186+
cond_resched();
11861187
}
11871188

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

0 commit comments

Comments
 (0)