]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Prevent allocating data larger than a page
authorAmery Hung <ameryhung@gmail.com>
Mon, 13 Apr 2026 19:02:57 +0000 (12:02 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 15 Apr 2026 19:10:20 +0000 (12:10 -0700)
commit36bf7beb9d23bfe7feba6f376a0c13ed7b670cf8
tree0dbfd5f3894a8f20636102bf58fc35c0377d3422
parentb3dde701e73354eb1c5027adbf01a147b056954a
selftests/bpf: Prevent allocating data larger than a page

Fix a bug in the task local data library that may allocate more than a
a page for tld_data_u. This may happen when users set a too large
TLD_DYN_DATA_SIZE, so check it when creating dynamic TLD fields and fix
the corresponding selftest.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Link: https://lore.kernel.org/r/20260413190259.358442-2-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/task_local_data.h
tools/testing/selftests/bpf/prog_tests/test_task_local_data.c