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=1796380869; b=2mUjf40jtNFrEx/XSjgiDEeC0Qb1d0GmhHH31ZpuGj0iuLJ1ZR2AB3OMCObDNJhH6u/Z 11kA8NXfd0sgpM1CtsWTluxE3oIxderIYqzKuFNB/BEv5THC9IWgiPrnbyzM1wLpJ/ror sAD7cuoqyOBNFn1AiiCCzQ0hjqEn3efL5cOOcgXd806z2KSNeCPAGj1oVx8Qw0+zVQwWG 01TQwjjJvM+qey0wFLtwlZ/w8ZFTEjwpWIXWqE1uB0ins5bmHpsHVGkJ9I/2IFtSLM5C8 C7mxMIXGsrEXtiJkdGrF+VHkuTw7uWxgEuyCe1ukxpmswLVLc566L6LDIxF6KIySK9A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380869; 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=D7yJ0hjjU/7mP6yJTun8VSsryGStcanQK15TGZx2JSE=; b=nzWpPr0irO7m5rZ2pObIHqHKQz89SSdt0sZs2yz2vZDVFpfxF6CNHWLeOx3t79trLM+w QTfKS+ufCEI+1xNF1qa75/Jic1z0Gkp0VjPqxeFBguW7E8KoPSka27nHwV47NGQKT8FWW vY+N92QPJj+gkt9DOHVAEtL5oiH9iX6KXQ/9jReOtF6JX6N0kfidUYgka09Z/HAS4ERBQ taVdnP2btnwykbAnvshdfVMWZThJYMORWaTGtpp08SKmq2Iqr8x7l23ueE9qnAMiNelIq NrRhUhacH18YepPInjOlOE+fOvTJhbQoqoAp+b/gcDsD374QlRnWBLSNLJEWdrKwHmQ== 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=h3tHvlWY; 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 6B935606A322; Fri, 4 Dec 2026 10:41:09 +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=h3tHvlWY Received: by smtp.kernel.org (Postfix) with ESMTPSA id D83641F000C2; Fri, 4 Dec 2026 10:41:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380869; bh=D7yJ0hjjU/7mP6yJTun8VSsryGStcanQK15TGZx2JSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=h3tHvlWYpUWKJTuIvXmBgcS3VQB8qvC4Bf2YiUzTfOBjdKZtV+nyBudiSZNfeqwwZ tDrBTdb/CTuxd5yBBwemsQupO98axhvffCun9qWH+bo70lEBujn+iyVzFisxTJWR63 hWBs3mpqXFSxgzpYgsumcyRK9AbMsEL8eg8IckvQ= 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 7.3 459/742] fault-inject: fix boot failure with fault injection boot parameters Date: Fri, 4 Dec 2026 19:05:23 +0900 Message-ID: <20261204100647.357563275@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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(-) --- 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 * 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;