mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 23:23:03 +00:00
bpf: Switch to krealloc_array()
Let the krealloc_array() copy the original data and check for a multiplication overflow. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240429120005.3539116-1-andriy.shevchenko@linux.intel.com
This commit is contained in:
parent
cb01621b6d
commit
a3034872cd
@ -850,7 +850,7 @@ int bpf_jit_add_poke_descriptor(struct bpf_prog *prog,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tab = krealloc(tab, size * sizeof(*poke), GFP_KERNEL);
|
||||
tab = krealloc_array(tab, size, sizeof(*poke), GFP_KERNEL);
|
||||
if (!tab)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user