tools/testing/selftests/bpf/progs/verifier_vfs_reject.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/verifier_vfs_reject.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/verifier_vfs_reject.c- Extension
.c- Size
- 4679 bytes
- Lines
- 177
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmlinux.herrno.hbpf/bpf_helpers.hbpf/bpf_tracing.hlinux/limits.hbpf_misc.hbpf_experimental.h
Detected Declarations
function __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msgfunction __msg
Annotated Snippet
SEC("fentry/vfs_open")
__failure __msg("calling kernel function bpf_path_d_path is not allowed")
int BPF_PROG(path_d_path_kfunc_non_lsm, struct path *path, struct file *f)
{
/* Calling bpf_path_d_path() from a non-LSM BPF program isn't permitted.
*/
bpf_path_d_path(path, buf, sizeof(buf));
return 0;
}
SEC("lsm.s/inode_rename")
__failure __msg("invalid mem access 'trusted_ptr_or_null_'")
int BPF_PROG(inode_rename, struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry,
unsigned int flags)
{
struct inode *inode = new_dentry->d_inode;
ino_t ino;
ino = inode->i_ino;
if (ino == 0)
return -EACCES;
return 0;
}
char _license[] SEC("license") = "GPL";
Annotation
- Immediate include surface: `vmlinux.h`, `errno.h`, `bpf/bpf_helpers.h`, `bpf/bpf_tracing.h`, `linux/limits.h`, `bpf_misc.h`, `bpf_experimental.h`.
- Detected declarations: `function __msg`, `function __msg`, `function __msg`, `function __msg`, `function __msg`, `function __msg`, `function __msg`, `function __msg`, `function __msg`, `function __msg`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.