include/linux/kstack_erase.h
Source file repositories/reference/linux-study-clean/include/linux/kstack_erase.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/kstack_erase.h- Extension
.h- Size
- 2423 bytes
- Lines
- 90
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched.hlinux/sched/task_stack.hasm/stacktrace.hlinux/linkage.h
Detected Declarations
function stackleak_task_low_boundfunction stackleak_task_high_boundfunction stackleak_find_top_of_poisonfunction stackleak_task_initfunction stackleak_task_init
Annotated Snippet
if (*(unsigned long *)sp == KSTACK_ERASE_POISON) {
poison_count++;
} else {
poison_count = 0;
poison_high = sp;
}
}
return poison_high;
}
static inline void stackleak_task_init(struct task_struct *t)
{
t->lowest_stack = stackleak_task_low_bound(t);
# ifdef CONFIG_KSTACK_ERASE_METRICS
t->prev_lowest_stack = t->lowest_stack;
# endif
}
asmlinkage void noinstr stackleak_erase(void);
asmlinkage void noinstr stackleak_erase_on_task_stack(void);
asmlinkage void noinstr stackleak_erase_off_task_stack(void);
void __no_caller_saved_registers noinstr __sanitizer_cov_stack_depth(void);
#else /* !CONFIG_KSTACK_ERASE */
static inline void stackleak_task_init(struct task_struct *t) { }
#endif
#endif
Annotation
- Immediate include surface: `linux/sched.h`, `linux/sched/task_stack.h`, `asm/stacktrace.h`, `linux/linkage.h`.
- Detected declarations: `function stackleak_task_low_bound`, `function stackleak_task_high_bound`, `function stackleak_find_top_of_poison`, `function stackleak_task_init`, `function stackleak_task_init`.
- 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.