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: 575995 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp2985970mab; Wed, 25 May 2022 01:17:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxDFS2VoeR7RtYCuGiq6k5l2Y4tMzeFu9FDKxlapQ4YfAGPzo/ge+TPWuWYZYjY7DW/eCA X-Received: by 2002:a92:ddcb:0:b0:2cf:8e55:e997 with SMTP id d11-20020a92ddcb000000b002cf8e55e997mr15656108ilr.8.1653466671588; Wed, 25 May 2022 01:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653466671; cv=none; d=google.com; s=arc-20160816; b=fArsdJvl5caG3W7rOjxbF6JWgJFa0CTLwQYo+FNm3LacAqrStfwt5D0j8epl4NAkFA bthd5kFi+CFzrdy+dDNy3eQp5AOJt8KIDseA6WZn9qdPAIH/kv/bFMyo2V/9RH+yJSCK khqAYnirAj8VKB38HRV9Ro4qVkVQqdJf+MC9XaJJCrZWxmoNFKjZeMde7J31LRDyB+SM szmxeIJtj5hh5Gz/iqsNa/BzMvudaWbbUtnqJbiVlO3nDniItvSAD8UqiJuC1XsRZHfC NYjS+/krHVvUwoktGUi8zCCSGsveQE6Bl1URHjTjpgsJpHoXk7fKVcFoveSI8mEtOUSq cs/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ipD9BF3dJUqbU5VJjMrUQqkuQrDLaKFfnbe7/ees/Z0=; b=Qt2tPiUVuvtxFE5S//epgXsLGqVnlfhO5EVXF0L/l4acG39LW9i2Ibsy7/gypqIF/Y Ln8eNEBPxY8TpqL7y1tK9plVUDHmsVLHHodJqPniVk7dKWrnBFvwsaG0jaNNd5UjcjTP Z+ziTk5ii09mFst3MQMa2mCwpobwsZoaC2vp5UIKOZ6vUSxD8ypBXaronoI55JaJ5abS y8i7AJVbAizJXwWofuOgnaE35yvugrl3xLhWMxzsSFAVl87cPDVyqJZO52Pot/sBpgjf ZAq+tQpFvv6kHxbVFE3oaCL6xeCYtx47bAB8iObSRA274qeSzdkxD2it8TdVG5Wb31jZ n71w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P+8uvXnw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id x14-20020a056638160e00b0032ed6dbc5f0si2715139jas.107.2022.05.25.01.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 01:17:51 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P+8uvXnw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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))