From patchwork Tue Jan 24 18:51:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 13114568 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BD9DC54EAA for ; Tue, 24 Jan 2023 18:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234101AbjAXSwh (ORCPT ); Tue, 24 Jan 2023 13:52:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234158AbjAXSw0 (ORCPT ); Tue, 24 Jan 2023 13:52:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 053E644BD1; Tue, 24 Jan 2023 10:52:08 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7EE5B61326; Tue, 24 Jan 2023 18:52:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0595C4339E; Tue, 24 Jan 2023 18:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674586328; bh=elP5tUEwCrTY71huuet3T+Fo7FOpVMVZKiKxptHmsR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oMhNbTOoyCDWwXiAn3txe/olFH7txY1maX+VNuyaiVCUGgq8yHK4Yh7bsc6g9nDAI CVehe8kFo7Ejy94Vcsm4aZqGa10U36KOpVzziSfsG0GSV+rB5gC0Ks2H22Zu5gWLUg 9H2MUSixcgU0w2N31sRebxKNzBxwZ4HRHnRpm21KdWOmfxiymSGabPzrkTeVbsBccv SD6gUbg4rafkFlPqYMVmdwS8SQj9HP3iISVGTxQgXNUotFVkJD41L84JiDlbzMjeZD n9g4tEomI3y7KhB809iIcWkmRbRmfi8DJfzT6ci7EGl65wGmfQHaret1HXC4cS4hh5 DOQs8N3Bum7UA== From: Eric Biggers To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Kees Cook , SeongJae Park , Seth Jenkins , Jann Horn , "Eric W . Biederman" , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Mladek , Andrew Morton , tangmeng , "Guilherme G. Piccoli" , Tiezhu Yang , Sebastian Andrzej Siewior , Luis Chamberlain Subject: [PATCH 5.15 12/20] panic: Separate sysctl logic from CONFIG_SMP Date: Tue, 24 Jan 2023 10:51:02 -0800 Message-Id: <20230124185110.143857-13-ebiggers@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230124185110.143857-1-ebiggers@kernel.org> References: <20230124185110.143857-1-ebiggers@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org From: Kees Cook commit 9360d035a579d95d1e76c471061b9065b18a0eb1 upstream. In preparation for adding more sysctls directly in kernel/panic.c, split CONFIG_SMP from the logic that adds sysctls. Cc: Petr Mladek Cc: Andrew Morton Cc: tangmeng Cc: "Guilherme G. Piccoli" Cc: Tiezhu Yang Cc: Sebastian Andrzej Siewior Reviewed-by: Luis Chamberlain Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20221117234328.594699-1-keescook@chromium.org Signed-off-by: Eric Biggers --- kernel/panic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/panic.c b/kernel/panic.c index 5ed1ad06f9a34..0b560312878c5 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -73,8 +73,9 @@ ATOMIC_NOTIFIER_HEAD(panic_notifier_list); EXPORT_SYMBOL(panic_notifier_list); -#if defined(CONFIG_SMP) && defined(CONFIG_SYSCTL) +#ifdef CONFIG_SYSCTL static struct ctl_table kern_panic_table[] = { +#ifdef CONFIG_SMP { .procname = "oops_all_cpu_backtrace", .data = &sysctl_oops_all_cpu_backtrace, @@ -84,6 +85,7 @@ static struct ctl_table kern_panic_table[] = { .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, +#endif { } };