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)
Fri, Nov 15, 1:13 AM
Unknown Object (File)
Thu, Oct 31, 3:38 AM
Unknown Object (File)
Wed, Oct 30, 12:36 PM
Unknown Object (File)
Oct 23 2024, 10:06 AM
Unknown Object (File)
Oct 22 2024, 2:55 PM
Unknown Object (File)
Oct 19 2024, 2:59 AM
Unknown Object (File)
Oct 18 2024, 3:06 AM
Unknown Object (File)
Oct 4 2024, 10:34 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.