From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,stable@vger.kernel.org,akinobu.mita@gmail.com,
ekffu200098@gmail.com,akpm@linux-foundation.org
Subject: + fault-inject-fix-boot-failure-with-fault-injection-boot-parameters.patch added to mm-nonmm-hotfixes-unstable branch
Date: Mon, 09 Nov 2026 21:34:47 -0800 [thread overview]
Message-ID: <20261110053447.C72271F0089F@smtp.kernel.org> (raw)
The patch titled
Subject: fault-inject: fix boot failure with fault injection boot parameters
has been added to the -mm mm-nonmm-hotfixes-unstable branch. Its filename is
fault-inject-fix-boot-failure-with-fault-injection-boot-parameters.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fault-inject-fix-boot-failure-with-fault-injection-boot-parameters.patch
This patch will later appear in the mm-nonmm-hotfixes-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Sang-Heon Jeon <ekffu200098@gmail.com>
Subject: fault-inject: fix boot failure with fault injection boot parameters
Date: Fri, 6 Nov 2026 01:01:58 +0900
Since commit e9bc360b105c ("fault-inject: use prandom where
cryptographically secure randomness is not needed"), setup_fault_attr()
calls prandom_init_once(), which calls kmalloc() and schedule_work().
But setup_fault_attr() can be called from __setup handlers before slab and
workqueues are initialized, so any fault injection boot parameter leads to
boot failure.
So use DO_ONCE_LITE() instead.
Link: https://lore.kernel.org/20261105160209.1504867-1-ekffu200098@gmail.com
Fixes: e9bc360b105c ("fault-inject: use prandom where cryptographically secure randomness is not needed")
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <stable@vger.kernel.org>
---
lib/fault-inject.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/lib/fault-inject.c~fault-inject-fix-boot-failure-with-fault-injection-boot-parameters
+++ a/lib/fault-inject.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/once_lite.h>
#include <linux/prandom.h>
#include <linux/debugfs.h>
#include <linux/sched.h>
@@ -50,7 +51,12 @@ int setup_fault_attr(struct fault_attr *
return 0;
}
- prandom_init_once(&fault_rnd_state);
+ /*
+ * __setup handlers run before slab and workqueues are initialized,
+ * but prandom_init_once() calls kmalloc() and schedule_work(). So use
+ * DO_ONCE_LITE() instead.
+ */
+ DO_ONCE_LITE(prandom_seed_full_state, &fault_rnd_state);
attr->probability = probability;
attr->interval = interval;
_
Patches currently in -mm which might be from ekffu200098@gmail.com are
mm-memory-remove-unused-vmf_insert_mixed_mkwrite.patch
mm-memory-remove-the-mkwrite-argument-from-__vm_insert_mixed.patch
mm-memory-merge-__vm_insert_mixed-into-vmf_insert_mixed.patch
fault-inject-fix-boot-failure-with-fault-injection-boot-parameters.patch
reply other threads:[~2026-11-10 5:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110053447.C72271F0089F@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=akinobu.mita@gmail.com \
--cc=ekffu200098@gmail.com \
--cc=mm-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox