diff options
| author | Hou Tao <[email protected]> | 2023-12-15 10:07:04 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-12-15 21:54:46 +0000 |
| commit | 8b2efe51ba85ca83460941672afac6fca4199df6 (patch) | |
| tree | 55651e550cb7ee3f6980a5edd33bf5ff6bf92181 /tools/net/ynl/generated/devlink-user.c | |
| parent | bpf: xdp: Register generic_kfunc_set with XDP programs (diff) | |
| download | kernel-8b2efe51ba85ca83460941672afac6fca4199df6.tar.gz kernel-8b2efe51ba85ca83460941672afac6fca4199df6.zip | |
bpf: Limit the number of uprobes when attaching program to multiple uprobes
An abnormally big cnt may be passed to link_create.uprobe_multi.cnt,
and 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 uprobes in
bpf_uprobe_multi_link_attach(). If the number of uprobes is greater than
MAX_UPROBE_MULTI_CNT, the attachment will return -E2BIG.
Fixes: 89ae89f53d20 ("bpf: Add multi uprobe link")
Reported-by: Xingwei Lee <[email protected]>
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]>
Closes: https://lore.kernel.org/bpf/CABOYnLwwJY=yFAGie59LFsUsBAgHfroVqbzZ5edAXbFE3YiNVA@mail.gmail.com
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/net/ynl/generated/devlink-user.c')
0 files changed, 0 insertions, 0 deletions
