Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp977378rwb; Tue, 29 Nov 2022 07:32:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf7+NuCkmwfjhWnyVZ/59lnWuhYSCsBdOEooM0u5ZFOyRtU+yay4EYAKvvzIR82l/ilKacEE X-Received: by 2002:a05:6a00:1d25:b0:562:5f71:d188 with SMTP id a37-20020a056a001d2500b005625f71d188mr39452729pfx.57.1669735973784; Tue, 29 Nov 2022 07:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669735973; cv=none; d=google.com; s=arc-20160816; b=iZRmlanRBsRIF2ayU3Rs2dHP5IGC4y9xuELfQGJb2RfBfqgxtja6PIdlST40PZuN4k wgBqWsNAUPnRoSEgjf1k0ZhjV+L/1sEYAGrPu5bD79unIkQyGTOqIVARD3Mv3tzeEwgD 9MELwjitvm1aOc9DTrCF05rkA7ztZSsioOjl1u3MJR5RVt8lbrCDGHWyzy0a98pfNOf8 bPLA9OJ3J+HG+D5Guxczu0tPmMZQPiV216h82WNK2tn/QSXCLwqN18wqATvT0j4CN83/ XpoK525aCKIG1qFt+z9jMkD2gz1gjPTmL8RJtxH3+71teosiKcZHnmJ6jryfa8rcKIYs 0emg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=J4G126L1kV/+4XjE2HY2cLVhYICxjzf7iRa82KCSixQ=; b=f78aOtQcXpTRY0CI5OeNXzNiDOutEwPO071UDEpPa0XlZV+FvlHLNPY6YOhK2Q10iE 1B3K2okzAKJwr1Vi5ky4Ev5FWGjrKtxk/eEfOyuc5bIF1UG5msue5IJvpEQuowy6iv9N wq/j/GzdE920XGsdgUosokbSfwtjmMxIWy8HRUIbc6FcWrrIACK1vdo9Mj+E5gIG85Yw xtfVRihgsIbx4LW3jwOCdA1DS+Y+tg46BFzITT03LUxTRhNPz+K/64gij61Q6HtMm3ZR hOGr14kuNorowEHtPiInJSXGRXSxB+Kd8MZK6m7OMiQZc5FFWCtQ64RPKUErjNhhh/At NRqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a625506000000b0054307ac90f1si14392415pfb.319.2022.11.29.07.32.41; Tue, 29 Nov 2022 07:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235721AbiK2Oc6 (ORCPT + 84 others); Tue, 29 Nov 2022 09:32:58 -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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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