Re: BUG: KASAN: null-ptr-deref in _raw_spin_lock_irq next-20240410

From: Dan Carpenter
Date: Thu Apr 11 2024 - 11:00:50 EST


On Thu, Apr 11, 2024 at 08:20:55PM +0530, Naresh Kamboju wrote:
>
> I use to notice kernel panic while running kunit tests
> now I have noticed this
>
> Unable to handle kernel paging request at virtual address
> KASAN: null-ptr-deref in range
> pc : kunit_test_null_dereference (lib/kunit/kunit-test.c:119)
> lr : kunit_generic_run_threadfn_adapter (lib/kunit/try-catch.c:31)
>
> The kunit tests run to completion and the system is stable.
> Kernel did not panic.
>

[ Snip ]

> <0>[ 76.808597] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
> <4>[ 76.809876] Modules linked in:
> <4>[ 76.812055] CPU: 1 PID: 567 Comm: kunit_try_catch Tainted: G
> B N 6.9.0-rc3-next-20240410 #1
> <4>[ 76.812987] Hardware name: linux,dummy-virt (DT)
> <4>[ 76.814123] pstate: 12400009 (nzcV daif +PAN -UAO +TCO -DIT
> -SSBS BTYPE=--)
> <4>[ 76.814947] pc : kunit_test_null_dereference (lib/kunit/kunit-test.c:119)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is a new intentional NULL dereferencer that was added yesterday.

Maybe these should have a big printk, "Intentional NULL dereference
coming up!\n".

regards,
dan carpenter