Files
Linux/kernel
Hou Tao d6d1e6c17c bpf: Limit the number of kprobes when attaching program to multiple kprobes
An abnormally big cnt may also be assigned to kprobe_multi.cnt when
attaching multiple kprobes. It will trigger the following warning in
kvmalloc_node():

	if (unlikely(size > INT_MAX)) {
	    WARN_ON_ONCE(!(flags & __GFP_NOWARN));
	    return NULL;
	}

Fix the warning by limiting the maximal number of kprobes in
bpf_kprobe_multi_link_attach(). If the number of kprobes is greater than
MAX_KPROBE_MULTI_CNT, the attachment will fail and return -E2BIG.

Fixes: 0dcac27254 ("bpf: Add multi kprobe link")
Signed-off-by: Hou Tao <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
2023-12-15 22:54:55 +01:00
..
2023-11-15 04:18:31 +01:00
2023-11-15 04:02:25 +01:00
…
…
…
…
…
…
…
…
2023-10-19 11:02:48 +02:00
2023-10-04 10:41:56 -07:00
…
2023-10-09 16:59:47 +10:00
…
2023-09-19 13:21:33 -07:00
…
2023-10-18 14:34:15 -07:00
…
…
…
…
2023-10-04 10:41:57 -07:00
…
…
2023-08-15 15:26:17 -07:00
…
…
…
2023-10-11 08:46:01 -07:00
…