Re: [linus:master] [kasan] 3738290bfc: kunit.kasan.fail

From: Alexander Potapenko
Date: Wed Jan 08 2025 - 11:20:20 EST


On Wed, Jan 8, 2025 at 5:03 PM Andrey Konovalov <andreyknvl@xxxxxxxxx> wrote:
>

> > [ 118.348258] CPU: 7 UID: 0 PID: 3613 Comm: kunit_try_catch Tainted: G B W N 6.12.0-rc6-00221-g3738290bfc99 #1
> > [ 118.359770] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
> > [ 118.365490] Hardware name: Dell Inc. OptiPlex 7050/062KRH, BIOS 1.2.0 12/22/2016
> > [ 118.373542] ==================================================================
> > [ 118.381677] not ok 4 kmalloc_track_caller_oob_right
>
> +Marco and Alexander
>
> Looks like KFENCE hijacked the allocation and reported the OOB instead
> of KASAN. There's a KASAN issue filed for this problem [1], but no
> solution implemented in the kernel so far.

If for some reason we want to keep both KFENCE and KASAN enabled on
that machine, we can use is_kfence_address() to check if an allocation
in a KASAN test was made from the KFENCE pool, and repeat it. This
won't look nice though, because we have several different allocation
APIs in the C test module alone, not to mention Rust.

> Perhaps, it makes sense to disable KFENCE when running the KASAN test
> suite on kernel test robot for now?

Looks like the simplest solution for now.