From mboxrd@z Thu Jan 1 00:00:00 1970 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 92E22C4321E for ; Tue, 29 Nov 2022 14:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235691AbiK2Oc5 (ORCPT ); Tue, 29 Nov 2022 09:32:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235708AbiK2Ocw (ORCPT ); Tue, 29 Nov 2022 09:32:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01C361EC7B; Tue, 29 Nov 2022 06:32:48 -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 719C96172F; Tue, 29 Nov 2022 14:32:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C38F5C433D7; Tue, 29 Nov 2022 14:32:46 +0000 (UTC) Date: Tue, 29 Nov 2022 09:32:45 -0500 From: Steven Rostedt To: Philipp Rudo Cc: Ricardo Ribalda , Eric Biederman , Jonathan Corbet , Sergey Senozhatsky , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, Ross Zwisler , linux-doc@vger.kernel.org, "Joel Fernandes (Google)" Subject: Re: [PATCH v1 2/2] kexec: Introduce kexec_reboot_disabled Message-ID: <20221129093245.599903e7@gandalf.local.home> In-Reply-To: <20221129144450.75a7181e@rotkaeppchen> References: <20221114-disable-kexec-reset-v1-0-fb51d20cf871@chromium.org> <20221114-disable-kexec-reset-v1-2-fb51d20cf871@chromium.org> <20221117160650.16e06b37@rotkaeppchen> <20221121150948.6f7c1f1f@rotkaeppchen> <20221124124000.5af23cad@rotkaeppchen> <20221124160115.23ae7928@rotkaeppchen> <20221128114200.72b3e2fe@gandalf.local.home> <20221129144450.75a7181e@rotkaeppchen> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Tue, 29 Nov 2022 14:44:50 +0100 Philipp Rudo wrote: > An alternative approach and sort of compromise I see is to convert > kexec_load_disabled from a simple on/off switch to a counter on how > often a kexec load can be made (in practice a tristate on/off/one-shot > should be sufficient). Ideally the reboot and panic path will > have separate counters. With that you could for example use > kexec_load_limit.reboot=0 and kexec_load_limit.panic=1 to disable the > load of images for reboot while still allow to load a crash kernel > once. With this you have the flexibility you need while also preventing > a race where an attacker overwrites your crash kernel before you can > toggle the switch. What do you think? I actually like this idea :-) -- Steve