include/linux/kmsan.h
Source file repositories/reference/linux-study-clean/include/linux/kmsan.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/kmsan.h- Extension
.h- Size
- 11791 bytes
- Lines
- 412
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source 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.
- 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/dma-direction.hlinux/gfp.hlinux/kmsan-checks.hlinux/types.h
Detected Declarations
struct pagestruct kmem_cachestruct task_structstruct scatterliststruct urbfunction memset_no_sanitize_memoryfunction kmsan_init_shadowfunction kmsan_task_createfunction kmsan_vunmap_range_noflushfunction kmsan_iounmap_page_range
Annotated Snippet
if (unlikely(__cond)) { \
WRITE_ONCE(kmsan_enabled, false); \
if (panic_on_kmsan) { \
/* Can't call panic() here because */ \
/* of uaccess checks. */ \
BUG(); \
} \
} \
__cond; \
})
#else
static inline void kmsan_init_shadow(void)
{
}
static inline void kmsan_init_runtime(void)
{
}
static inline bool __must_check kmsan_memblock_free_pages(struct page *page,
unsigned int order)
{
return true;
}
static inline void kmsan_task_create(struct task_struct *task)
{
}
static inline void kmsan_task_exit(struct task_struct *task)
{
}
static inline void kmsan_alloc_page(struct page *page, unsigned int order,
gfp_t flags)
{
}
static inline void kmsan_free_page(struct page *page, unsigned int order)
{
}
static inline void kmsan_copy_page_meta(struct page *dst, struct page *src)
{
}
static inline void kmsan_slab_alloc(struct kmem_cache *s, void *object,
gfp_t flags)
{
}
static inline void kmsan_slab_free(struct kmem_cache *s, void *object)
{
}
static inline void kmsan_kmalloc_large(const void *ptr, size_t size,
gfp_t flags)
{
}
static inline void kmsan_kfree_large(const void *ptr)
{
}
static inline int __must_check kmsan_vmap_pages_range_noflush(
unsigned long start, unsigned long end, pgprot_t prot,
struct page **pages, unsigned int page_shift, gfp_t gfp_mask)
{
return 0;
}
static inline void kmsan_vunmap_range_noflush(unsigned long start,
unsigned long end)
{
}
static inline int __must_check kmsan_ioremap_page_range(unsigned long start,
unsigned long end,
phys_addr_t phys_addr,
pgprot_t prot,
unsigned int page_shift)
{
return 0;
}
static inline void kmsan_iounmap_page_range(unsigned long start,
unsigned long end)
{
Annotation
- Immediate include surface: `linux/dma-direction.h`, `linux/gfp.h`, `linux/kmsan-checks.h`, `linux/types.h`.
- Detected declarations: `struct page`, `struct kmem_cache`, `struct task_struct`, `struct scatterlist`, `struct urb`, `function memset_no_sanitize_memory`, `function kmsan_init_shadow`, `function kmsan_task_create`, `function kmsan_vunmap_range_noflush`, `function kmsan_iounmap_page_range`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.