]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
samples/damon/mtier: support boot time enable setup
authorSeongJae Park <sj@kernel.org>
Sun, 6 Jul 2025 19:32:04 +0000 (12:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:35 +0000 (18:41 +0200)
commitdd1f0f4bfbc5cbe97d1c84ded69ac4d334e50e13
tree103e9ba967cf4b346f0ce6f5a9fb811944a90386
parenta10eb325706c46591a270d3a0ae872efa4558d85
samples/damon/mtier: support boot time enable setup

commit 964314344eab7bc43e38a32be281c5ea0609773b upstream.

If 'enable' parameter of the 'mtier' DAMON sample module is set at boot
time via the kernel command line, memory allocation is tried before the
slab is initialized.  As a result kernel NULL pointer dereference BUG can
happen.  Fix it by checking the initialization status.

Link: https://lkml.kernel.org/r/20250706193207.39810-4-sj@kernel.org
Fixes: 82a08bde3cf7 ("samples/damon: implement a DAMON module for memory tiering")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
samples/damon/mtier.c