Re: [PATCH 4/4] mm: kfence: Only load kfence_test when kfence is enabled

From: Marco Elver
Date: Wed Aug 25 2021 - 05:54:27 EST


On Wed, 25 Aug 2021 at 11:31, Alexander Potapenko <glider@xxxxxxxxxx> wrote:
> On Wed, Aug 25, 2021 at 11:17 AM Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> wrote:
> >
> > Provide kfence_is_enabled() helper, only load kfence_test module
> > when kfence is enabled.
>
> What's wrong with the current behavior?
> I think we need at least some way to tell the developer that KFENCE
> does not work, and a failing test seems to be the perfect one.

Like Alex said, this is working as intended. The KFENCE test verifies
that everything is working as expected, *including* that KFENCE was
enabled, and has already helped us identify issues where we expected
it to be enabled! Trying to run the test when KFENCE was intentionally
disabled is therefore not a useful usecase.

Please drop this patch.