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
F82076074: D29454.diff
Thu, Apr 25, 7:10 AM
Unknown Object (File)
Wed, Apr 17, 1:04 AM
Unknown Object (File)
Sat, Apr 6, 6:00 PM
Unknown Object (File)
Jan 12 2024, 2:42 AM
Unknown Object (File)
Dec 23 2023, 3:49 AM
Unknown Object (File)
Nov 7 2023, 3:30 AM
Unknown Object (File)
Oct 6 2023, 2:23 AM
Unknown Object (File)
Sep 11 2023, 2:57 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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
95

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
95

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
95

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
95

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.