Page MenuHomeFreeBSD

Add a KASAN option to the kernel build
ClosedPublic

Authored by markj on Mar 27 2021, 11:26 PM.
Tags
None
Referenced Files
F55432721: D29454.diff
Fri, Jan 27, 11:13 AM
Unknown Object (File)
Dec 27 2022, 2:14 PM
Unknown Object (File)
Dec 27 2022, 2:08 PM
Unknown Object (File)
Dec 27 2022, 2:07 PM
Unknown Object (File)
Dec 20 2022, 2:21 AM
Unknown Object (File)
Dec 15 2022, 4:46 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38125
Build 35014: arc lint + arc unit

Event Timeline

emaste added inline comments.
sys/conf/kern.pre.mk
110

I wonder if (as a later change) we should get config(8) to generate a Makefile.config.inc or such that we can include?

sys/conf/kern.pre.mk
110

I don't quite follow the suggestion. You mean we would end up with a Makefile.KASAN.inc or so?

sys/conf/kern.pre.mk
110

Something like Makefile.options.inc that contains KASAN_ENABLED=yes and such, rather than invoking grep n times

This looks good to me, modulo the refactoring idea it inspired.

sys/conf/kern.pre.mk
110

Hmmm, we've grown a lot of these grep commands. I wrote a generic version of this some time ago (7.x? 8.x?)e. I thought I'd committed it, but it appears that I didn't.

Personally, I'd create a mk.$OPTION file in $S/conf. For all options that are enabled that have a mk.$OPTION have config write them into the makefile at %BEFORE_DEPEND.

But I'll be the first to admit this is beyond the scope of this patch.

This revision is now accepted and ready to land.Mar 28 2021, 4:03 PM
sys/conf/kern.pre.mk
110

I'll have to add another of these for KMSAN, so a better solution is indeed warranted. The approach of having mk.KASAN seems good. We'd need to audit all of the existing uses of "grep <OPTION> opt_foo.h" to make sure they're all amenable to this approach.

This revision was automatically updated to reflect the committed changes.