kernel/bpf/net_namespace.c
Source file repositories/reference/linux-study-clean/kernel/bpf/net_namespace.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/bpf/net_namespace.c- Extension
.c- Size
- 13286 bytes
- Lines
- 566
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bpf.hlinux/bpf-netns.hlinux/filter.hnet/net_namespace.h
Detected Declarations
struct bpf_netns_linkfunction netns_bpf_attach_type_unneedfunction netns_bpf_attach_type_needfunction netns_bpf_run_array_detachfunction link_indexfunction list_for_each_entryfunction link_countfunction fill_prog_arrayfunction list_for_each_entryfunction bpf_netns_link_releasefunction bpf_netns_link_detachfunction bpf_netns_link_deallocfunction bpf_netns_link_update_progfunction bpf_netns_link_fill_infofunction bpf_netns_link_show_fdinfofunction __netns_bpf_prog_queryfunction netns_bpf_prog_queryfunction netns_bpf_prog_attachfunction __netns_bpf_prog_detachfunction netns_bpf_prog_detachfunction netns_bpf_max_progsfunction netns_bpf_link_attachfunction netns_bpf_link_createfunction netns_bpf_pernet_initfunction netns_bpf_pernet_pre_exitfunction list_for_each_entryfunction netns_bpf_initmodule init netns_bpf_init
Annotated Snippet
subsys_initcall(netns_bpf_init);
Annotation
- Immediate include surface: `linux/bpf.h`, `linux/bpf-netns.h`, `linux/filter.h`, `net/net_namespace.h`.
- Detected declarations: `struct bpf_netns_link`, `function netns_bpf_attach_type_unneed`, `function netns_bpf_attach_type_need`, `function netns_bpf_run_array_detach`, `function link_index`, `function list_for_each_entry`, `function link_count`, `function fill_prog_array`, `function list_for_each_entry`, `function bpf_netns_link_release`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.