From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382347; b=fFpVIDOSe7rADISxbBNk81gkjt8Di+NrKU9NDnYxIZJlIWDD1AyQi1fhsoExKqcNE16/ QN/d7FVbjO8k+91kEV7sE3jEshzpK94LKwdDM6rFfC1e6NwtqgFFsadmv8dKwZJRhKvVJ qOKz4V9/pwJBeMsoP+UYzmFToI26U+U1ccjcz53WqfBdYBRUCXrt0AbVdsEm0IAWzFrad k9A7DfuJqW1x5ZfVCF4BDl05T0An7VbIhB0xKgYfkCWr+J42v4BfRt+7EZiUiDvJ7sKn8 rVHvrdi7rt/OmtPLLNbWv63TEjg+VvHgTwI6l9p1Jun3I832cJzqnkhPyEmJK9oV+QQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382347; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=8ZaQsWTrCmcHNMEqyRtNQ9yzuUUbmhdfguFLqQEMXl4=; b=io7e+NT4/pMv7D6q25IDygRz4pjokWYs6vu8Y5AvkyCVPd8abHq8fiV2H8mWa4SjAXaI NajcwWYMzr1h7pxadEp0eREh2SK8YTKoAXcJFdVCr403kAK+ewkWmeCXCnad/K7ASulFm ChtHrF/022kum6GkBQyRCb4aoko/y95WHnZfzO21uNLiCSGlJrT/hR5sEhEe8/M5WvPGN PRFPOP+u+NR+owY1QTJLBu6q6gqQa0K8fhSRqk7Xedfrg0cge6Kvy6jNvXeBwx6XG5bP6 RClcTLO0pNYNkFV7+CWvhexn/MvF5aVMwqrOAKExuI0r0bUtpnYmWGzo+v8+zUTSa8A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SZA1cDGy; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C02B4606A322; Fri, 4 Dec 2026 11:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SZA1cDGy Received: by smtp.kernel.org (Postfix) with ESMTPSA id D468D1F000C2; Fri, 4 Dec 2026 11:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382347; bh=8ZaQsWTrCmcHNMEqyRtNQ9yzuUUbmhdfguFLqQEMXl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SZA1cDGywANUUCBNsUIjAPPwjkv4B9T+Cr5kBLX0bR0izHACg1JiSaIk3AE+IjOvz ikwavuyatcxC6MtPoxp/Uw2lYvngadUsWBFpIdq00tXA9Gr2Qu8cgABTuKbAZ5VG30 Vw40ZoNZKwQwaRknxcFK7rw8MrsuTSGVBLFXnpI0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sang-Heon Jeon , Andrew Morton , Akinobu Mita Subject: [PATCH 6.18 415/703] fault-inject: fix boot failure with fault injection boot parameters Date: Fri, 4 Dec 2026 19:05:14 +0900 Message-ID: <20261204100638.870952246@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sang-Heon Jeon commit 27538caf7f72ce93be9c352148dba4f2274cf300 upstream. 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 Signed-off-by: Andrew Morton Reviewed-by: Akinobu Mita Cc: Signed-off-by: Greg Kroah-Hartman lib/fault-inject.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- lib/fault-inject.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/fault-inject.c b/lib/fault-inject.c index 02916ef2761c..9182d457baf5 100644 --- a/lib/fault-inject.c +++ b/lib/fault-inject.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only #include #include +#include #include #include #include @@ -50,7 +51,12 @@ int setup_fault_attr(struct fault_attr *attr, char *str) 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; -- 2.56.1