aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/syscall-counts-by-pid.py
diff options
context:
space:
mode:
authorKP Singh <[email protected]>2020-11-06 10:37:46 +0000
committerAlexei Starovoitov <[email protected]>2020-11-06 08:08:38 -0800
commit9cde3beeadb311d4b435a7d28d5ab72bcc5de65d (patch)
tree89ba3159e7b5be9c9a4ba0e1ff139fefbd6b3e97 /tools/perf/scripts/python/syscall-counts-by-pid.py
parenta367efa71b3f5a53281ca9772f8bf43166dfdf5f (diff)
bpf: Add tests for task_local_storage
The test exercises the syscall based map operations by creating a pidfd for the current process. For verifying kernel / LSM functionality, the test implements a simple MAC policy which denies an executable from unlinking itself. The LSM program bprm_committed_creds sets a task_local_storage with a pointer to the inode. This is then used to detect if the task is trying to unlink itself in the inode_unlink LSM hook. The test copies /bin/rm to /tmp and executes it in a child thread with the intention of deleting itself. A successful test should prevent the the running executable from deleting itself. The bpf programs are also updated to call bpf_spin_{lock, unlock} to trigger the verfier checks for spin locks. The temporary file is cleaned up later in the test. Signed-off-by: KP Singh <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts-by-pid.py')
0 files changed, 0 insertions, 0 deletions