From patchwork Wed May 25 08:18:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 1635328 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=P+8uvXnw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L7P806s1Mz9sGH for ; Wed, 25 May 2022 18:17:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B5DC384323; Wed, 25 May 2022 10:17:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="P+8uvXnw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54A8684315; Wed, 25 May 2022 10:17:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A6C084315 for ; Wed, 25 May 2022 10:17:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id n18so17942906plg.5 for ; Wed, 25 May 2022 01:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ipD9BF3dJUqbU5VJjMrUQqkuQrDLaKFfnbe7/ees/Z0=; b=P+8uvXnwrEL1NIrhpmR+p/w6iA1plbCZc6vnFCUy94fxSczcqzPSjgqZOtvH3Wzu2O uLijaJyJhleylRpCMfQxTIuu8xHVgHN8f0yitJhWQDwTICAD9bCOzNh6fjoamcL7ILDB 6KfJBnpzAgukIpGsq4BuSgvubPJFORFcNzTG0Z0Hjd83qpNlEVBbpo/9i5UIzfbCNDTJ qMlqn05dDv6WrxC7iYAqNk45y/POYsDtiumfMghYCGPEWSfR6Gt+OLGulKX28vdFZ3Q4 gFRO6evDMWiZay1TndURwvPcvjrvktXcUxNJ4/uPHxMIwFyYRJFEl5mcxniKbAyNk6Yp 1kdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ipD9BF3dJUqbU5VJjMrUQqkuQrDLaKFfnbe7/ees/Z0=; b=egt89vEA8hj1D6/p0SU5aBiYssFJcJS1ToF+rDTr2peuG9Qq7U5s/3aRS4E+4/22gN j1YJToMDPNNlu1UHvRlRMGTBEvUyTIqlVwE6m3V9bG4bYqwJAOfyfSUFt8T5OU8V4ShX 1SgFKGNMyRvBfp7/fXv7glQ0aFR6cWQkp0561wSJ7FFhpeTqJ9LcVCt9raNTOo5qpAYX +IuZsL6PyIBRbBq4p8sSqrHPCzvxNkMmFEgfmH/TNZ6ngokxsuCPOHOuevOB1QygOlLD my3gIk9kx5KTwOXBVe1jN8CUcODZyv8RuSu6r/xox7syBxZ3u4bLf3ZXsNZtxnV5cOg+ 6YDQ== X-Gm-Message-State: AOAM5313zgMw9AcwVuyB1qgWD9DSo6XpKUvS5PT0EJns38qHLlvZJnwU Hj53ihp8prLwr0pX1cFLzYYTktCJ54whfQ== X-Google-Smtp-Source: ABdhPJypFIqxERcWdHSUY9oX+cyRaXjK8sFN9GsU9tCY0aBRcRqxvtZnTqa/l1xrnGGdXdSBCn2i6w== X-Received: by 2002:a17:902:dac7:b0:161:c7ed:38e1 with SMTP id q7-20020a170902dac700b00161c7ed38e1mr31969785plx.55.1653466643791; Wed, 25 May 2022 01:17:23 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id a8-20020a1709027d8800b00162529828aesm2021225plm.109.2022.05.25.01.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 01:17:23 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Pali Rohar , Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Mark Kettenis , Masahisa Kojima , Simon Glass , Alexandru Gagniuc , Steffen Jaeckel , Michal Simek , Ovidiu Panait , Ashok Reddy Soma Subject: [PATCH 2/2] bootmenu: U-Boot console is enabled as default Date: Wed, 25 May 2022 17:18:13 +0900 Message-Id: <20220525081813.26214-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220525081813.26214-1-masahisa.kojima@linaro.org> References: <20220525081813.26214-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean The commit 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console") disables to enter U-Boot console from bootmenu as default, this change affects the existing bootmenu users. This commit reverts the default behavior, the bootmenu can enter U-Boot console same as before. CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is renamed BOOTMENU_DISABLE_UBOOT_CONSOLE and depends on AUTOBOOT_MENU_SHOW. Fixes: 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console") Signed-off-by: Masahisa Kojima --- boot/Kconfig | 9 +++++++++ cmd/Kconfig | 10 ---------- cmd/bootmenu.c | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index dff4d23b88..2eae3d5c6b 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1143,6 +1143,15 @@ config AUTOBOOT_MENU_SHOW environmnent variable (if enabled) and before handling the boot delay. See README.bootmenu for more details. +config BOOTMENU_DISABLE_UBOOT_CONSOLE + bool "Disallow bootmenu to enter the U-Boot console" + depends on AUTOBOOT_MENU_SHOW + default n + help + If this option is enabled, user can not enter + the U-Boot console from bootmenu. It increases + the system security. + config BOOT_RETRY bool "Boot retry feature" help diff --git a/cmd/Kconfig b/cmd/Kconfig index 69c1814d24..09193b61b9 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -357,16 +357,6 @@ config CMD_BOOTMENU help Add an ANSI terminal boot menu command. -config CMD_BOOTMENU_ENTER_UBOOT_CONSOLE - bool "Allow Bootmenu to enter the U-Boot console" - depends on CMD_BOOTMENU - default n - help - Add an entry to enter U-Boot console in bootmenu. - If this option is disabled, user can not enter - the U-Boot console from bootmenu. It increases - the system security. - config CMD_ADTIMG bool "adtimg" help diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index bf88c2127b..1002c6b20a 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -362,7 +362,7 @@ static struct bootmenu_data *bootmenu_create(int delay) goto cleanup; /* Add Quit entry if entering U-Boot console is disabled */ - if (IS_ENABLED(CONFIG_CMD_BOOTMENU_ENTER_UBOOT_CONSOLE)) + if (!IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE)) entry->title = strdup("U-Boot console"); else entry->title = strdup("Quit"); @@ -595,7 +595,7 @@ int menu_show(int bootdelay) if (ret == BOOTMENU_RET_UPDATED) continue; - if (!IS_ENABLED(CONFIG_CMD_BOOTMENU_ENTER_UBOOT_CONSOLE)) { + if (IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE)) { if (ret == BOOTMENU_RET_QUIT) { /* default boot process */ if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR))