tools/testing/selftests/bpf/progs/verifier_ctx_ptr_param.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/verifier_ctx_ptr_param.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/progs/verifier_ctx_ptr_param.c- Extension
.c- Size
- 1573 bytes
- Lines
- 69
- 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
linux/bpf.hbpf/bpf_helpers.hbpf/bpf_tracing.hbpf_misc.h
Detected Declarations
function Copyrightfunction __retvalfunction __retvalfunction __retval
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Verifier tests for single- and multi-level pointer parameter handling
* Copyright (c) 2026 CrowdStrike, Inc.
*/
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include "bpf_misc.h"
SEC("fentry/bpf_fentry_test_ppvoid")
__description("fentry/void**: void ** inferred as scalar")
__success __retval(0)
__log_level(2)
__msg("R1=ctx() R2=scalar()")
__naked void fentry_ppvoid_as_scalar(void)
{
asm volatile (" \
r2 = *(u64 *)(r1 + 0); \
r0 = 0; \
exit; \
" ::: __clobber_all);
}
SEC("fentry/bpf_fentry_test_pppvoid")
__description("fentry/void***: void *** inferred as scalar")
__success __retval(0)
__log_level(2)
__msg("R1=ctx() R2=scalar()")
__naked void fentry_pppvoid_as_scalar(void)
{
asm volatile (" \
r2 = *(u64 *)(r1 + 0); \
r0 = 0; \
exit; \
" ::: __clobber_all);
}
SEC("fentry/bpf_fentry_test_ppfile")
__description("fentry/struct file**: struct file ** inferred as scalar")
__success __retval(0)
__log_level(2)
__msg("R1=ctx() R2=scalar()")
__naked void fentry_ppfile_as_scalar(void)
{
asm volatile (" \
r2 = *(u64 *)(r1 + 0); \
r0 = 0; \
exit; \
" ::: __clobber_all);
}
SEC("fexit/bpf_fexit_test_ret_ppfile")
__description("fexit/return struct file**: returned struct file ** inferred as scalar")
__success __retval(0)
__log_level(2)
__msg("R1=ctx() R2=scalar()")
__naked void fexit_ppfile_as_scalar(void)
{
asm volatile (" \
r2 = *(u64 *)(r1 + 0); \
r0 = 0; \
exit; \
" ::: __clobber_all);
}
char _license[] SEC("license") = "GPL";
Annotation
- Immediate include surface: `linux/bpf.h`, `bpf/bpf_helpers.h`, `bpf/bpf_tracing.h`, `bpf_misc.h`.
- Detected declarations: `function Copyright`, `function __retval`, `function __retval`, `function __retval`.
- 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.