]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add non-BPF_LSM test for task local storage
authorSong Liu <songliubraving@fb.com>
Thu, 25 Feb 2021 23:43:16 +0000 (15:43 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Feb 2021 19:51:48 +0000 (11:51 -0800)
commitdb61c4314a584f4f57c0eaf43c93003e9326ef69
treedb016f90ba6da4f318862d36d17f97ffaf237cf6
parent66425c17535c0f364fe78df2650c0699f2275a59
selftests/bpf: Add non-BPF_LSM test for task local storage

Task local storage is enabled for tracing programs. Add two tests for
task local storage without CONFIG_BPF_LSM.

The first test stores a value in sys_enter and read it back in sys_exit.

The second test checks whether the kernel allows allocating task local
storage in exit_creds() (which it should not).

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210225234319.336131-4-songliubraving@fb.com
tools/testing/selftests/bpf/prog_tests/task_local_storage.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/task_local_storage.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/task_local_storage_exit_creds.c [new file with mode: 0644]