aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_autoload.c
diff options
context:
space:
mode:
authorJeongjun Park <[email protected]>2024-08-31 14:47:02 +0900
committerAlexei Starovoitov <[email protected]>2024-09-04 11:56:34 -0700
commitbb6705c3f93bed2af03d43691743d4c43e3c8e6f (patch)
tree930dce457cb48dc146e4fadd65db839cdb2487d4 /tools/testing/selftests/bpf/progs/test_autoload.c
parentb408473ea01b2e499d23503e2bf898416da9d7ac (diff)
bpf: add check for invalid name in btf_name_valid_section()
If the length of the name string is 1 and the value of name[0] is NULL byte, an OOB vulnerability occurs in btf_name_valid_section() and the return value is true, so the invalid name passes the check. To solve this, you need to check if the first position is NULL byte and if the first character is printable. Suggested-by: Eduard Zingerman <[email protected]> Fixes: bd70a8fb7ca4 ("bpf: Allow all printable characters in BTF DATASEC names") Signed-off-by: Jeongjun Park <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Eduard Zingerman <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions