google / kernel-sanitizers

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

Allow using KFENCE together with KASAN #117

Closed ramosian-glider closed 4 years ago

ramosian-glider commented 4 years ago

Sure, I'll send this patch separately.

On Fri, Jul 31, 2020 at 6:53 PM Marco Elver notifications@github.com wrote:

@melver commented on this pull request.

In include/linux/slub_def.h https://github.com/google/kasan/pull/117#discussion_r463721557:

@@ -7,6 +7,7 @@ *

  • (C) 2007 SGI, Christoph Lameter */ +#include <linux/kasan.h>

Should we send patches to fix KFENCE unrelated things before RFC?

If we can get this fixed in mainline before would be good, as it saves us a patch in the series. WDYT?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/google/kasan/pull/117#pullrequestreview-459319723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG6Z4Z6JUEOQULXVEB5J33R6LZKFANCNFSM4PQLHSQQ .

melver commented 4 years ago

Sure, I'll send this patch separately.

Hmm, I investigated a bit more and for some reason include/linux/sl*b_def.h don't include dependencies for structs on purpose it seems. So my guess is, such a patch will be rejected.

We just have to include <linux/slab.h> in kfence/kfence.h, which should solve it (because linux/slab.h includes kasan.h and hopefully any other future dependencies? although it is a bit of a mess..). I have some more fixes queued and will send Monday.