google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
436 stars 87 forks source link

[kfence] Make compatible with KASAN #106

Closed melver closed 4 years ago

melver commented 4 years ago

Figure out if we can make KFENCE compatible with KASAN.

Maybe we can make the Kconfig option look like:

depends on HAVE_ARCH_KFENCE && (!KASAN || EXPERT) && (SLAB || SLUB)

Because it makes little sense to normally have both KASAN and KFENCE.

However, for us it does make sense. Because KFENCE does all kinds of interesting memory accesses at various boundaries, we are at risk of subtle bugs if not careful. Therefore, it would be good to test KFENCE with KASAN to check that KFENCE itself is sound.

melver commented 4 years ago

E.g. https://github.com/google/kasan/issues/102 would have been caught by KASAN.

melver commented 4 years ago

Resolved by @ramosian-glider in https://github.com/google/kasan/pull/117.