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.

Dependency Surface

Detected Declarations

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

Implementation Notes