Page MenuHomeFreeBSD

amd64: Add MD bits for KASAN
ClosedPublic

Authored by markj on Mar 27 2021, 11:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 12 2024, 1:49 PM
Unknown Object (File)
Jan 22 2024, 4:26 AM
Unknown Object (File)
Jan 12 2024, 2:44 AM
Unknown Object (File)
Dec 22 2023, 10:34 PM
Unknown Object (File)
Aug 27 2023, 2:40 PM
Unknown Object (File)
Aug 22 2023, 1:55 AM
Unknown Object (File)
Aug 13 2023, 6:36 AM
Unknown Object (File)
Aug 4 2023, 11:38 AM
Subscribers

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
rG FreeBSD src repository
Lint
Lint Not Applicable
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
138

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
138

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.Apr 13 2021, 9:42 PM
This revision was automatically updated to reflect the committed changes.