History

selftests/bpf: Fix stat probe in d_path test

Some kernels builds might inline vfs_getattr call within fstat syscall code path, so fentry/vfs_getattr trampoline is not called. Add security_inode_getattr to allowlist and switch the d_path test stat trampoline to security_inode_getattr. Keeping dentry_open and filp_close, because they are in their own files, so unlikely to be inlined, but in case they are, adding security_file_open. Adding flags that indicate trampolines were called and failing the test if any of them got missed, so it's easier to identify the issue next time.

Jiri Olsa committed 6 years ago

Commit a8a71791 parent c69d2dd3 files · +26 −1Browse files

Showing the changes to kernel (1 of 3 files). Show all

Unified · Split

kernel/trace/bpf_trace.c+8−0
@@ -1114,6 +1114,14 @@ BPF_CALL_3(bpf_d_path, struct path *, path, char *, buf, u32, sz) · 1113 unmodified lines
1114}1114}
1115 1115
1116BTF_SET_START(btf_allowlist_d_path)1116BTF_SET_START(btf_allowlist_d_path)
1117#ifdef CONFIG_SECURITY
1118BTF_ID(func, security_file_permission)
1119BTF_ID(func, security_inode_getattr)
1120BTF_ID(func, security_file_open)
1121#endif
1122#ifdef CONFIG_SECURITY_PATH
1123BTF_ID(func, security_path_truncate)
1124#endif
1117BTF_ID(func, vfs_truncate)1125BTF_ID(func, vfs_truncate)
1118BTF_ID(func, vfs_fallocate)1126BTF_ID(func, vfs_fallocate)
1119BTF_ID(func, dentry_open)1127BTF_ID(func, dentry_open)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t