Hou Tao c930472552 bpf: Ensure unit_size is matched with slab cache object size
Add extra check in bpf_mem_alloc_init() to ensure the unit_size of
bpf_mem_cache is matched with the object_size of underlying slab cache.
If these two sizes are unmatched, print a warning once and return
-EINVAL in bpf_mem_alloc_init(), so the mismatch can be found early and
the potential issue can be prevented.

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20230908133923.2675053-4-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-09-11 12:41:37 -07:00
..
2023-03-08 16:19:51 -08:00
2023-09-02 11:10:50 -07:00
2023-05-16 19:50:05 -07:00
2022-05-10 11:20:45 -07:00
2023-04-29 10:05:22 -07:00
2020-08-28 15:41:30 +02:00
2023-07-31 14:44:02 -07:00