Page MenuHomeFreeBSD

amd64: Add MD bits for KASAN
ClosedPublic

Authored by markj on Mar 27 2021, 11:28 PM.
Tags
None
Referenced Files
F170758590: D29455.id.diff
Sun, Sep 6, 11:11 AM
F170743330: D29455.id86501.diff
Sun, Sep 6, 9:03 AM
F170722643: D29455.id87405.diff
Sun, Sep 6, 5:34 AM
F170691192: D29455.id87405.diff
Sun, Sep 6, 1:26 AM
F170677562: D29455.id86501.diff
Sat, Sep 5, 11:44 PM
Unknown Object (File)
Thu, Sep 3, 8:11 PM
Unknown Object (File)
Thu, Sep 3, 6:39 PM
Unknown Object (File)
Thu, Sep 3, 2:48 PM
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.