Page MenuHomeFreeBSD

amd64: Add MD bits for KASAN
ClosedPublic

Authored by markj on Mar 27 2021, 11:28 PM.

Details

Summary


- Initialize KASAN before executing SYSINITs.
- Add a kernel config.
- Increase the kernel stack size if KASAN is enabled. Some of the
ASAN instrumentation increases stack usage and it's enough to
trigger stack overflows in ZFS.
- Mark the trapframe as valid in interrupt handlers if it is
assigned to td_intr_frame. Otherwise, an interrupt in a function
which creates a poisoned alloca region can trigger false positives.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

andrew added inline comments.
sys/amd64/conf/GENERIC-KMSAN
7 ↗(On Diff #86412)

KMSAN?

sys/amd64/include/param.h
137

Why do we need more pages for KASAN?

markj added inline comments.
sys/amd64/conf/GENERIC-KMSAN
7 ↗(On Diff #86412)

I have a WIP KMSAN port as well, just didn't split this commit properly.

sys/amd64/include/param.h
137

Some of the ASAN options seem to increase stack usage rather substantially. I was able to trigger a double fault with ZFS due to a stack overflow with 4 kstack pages.

markj marked an inline comment as done.

Remove KMSAN config.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Apr 13, 9:42 PM
This revision was automatically updated to reflect the committed changes.