mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
bpf: Account scratch buffer in bpf_prog_calc_tag
bpf_prog_calc_tag() copies the instructions into a plain vmalloc() scratch buffer to blind the map fds before hashing. The buffer scales with the program, up to ~8MB at the 1M instruction limit, and is allocated on every program load, but unlike the rest of the load-time scratch memory it is not charged to the loader's memcg. Use GFP_KERNEL_ACCOUNT to account it like the other allocations scoped to the verification/load. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20260708211537.371874-5-daniel@iogearbox.net Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
parent
42560699a8
commit
ff755b6007
|
|
@ -305,7 +305,7 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
|
|||
bool was_ld_map;
|
||||
u32 i;
|
||||
|
||||
dst = vmalloc(size);
|
||||
dst = __vmalloc(size, GFP_KERNEL_ACCOUNT);
|
||||
if (!dst)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user