kcov: initial implementation

Implement a device (/dev/kcov) that exposes coverage info for the
kernel. This will be especially useful for coverage-based fuzzing (e.g.
syzkaller).

Exclude a lot of functions which would crash/otherwise interfere in the
coverage, including only processing coverage callbacks when not handling
an irq.
This commit is contained in:
Matheus
2026-10-06 11:05:58 -03:00
parent 111a8696d8
commit e4a4896b4b
14 changed files with 581 additions and 25 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ void arch_extracontext_save(extracontext_t *context) {
}
}
void arch_extracontext_load(extracontext_t *context) {
KCOV_DISABLED void arch_extracontext_load(extracontext_t *context) {
if (current_thread()->proc && current_thread()->proc->ldt)
arch_gdt_set_ldt(current_thread()->proc->ldt, 0xffff);
else