Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pcHUO-0007xA-4I for mharc-grub-devel@gnu.org; Tue, 14 Mar 2023 23:07:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcHUM-0007wz-Ct for grub-devel@gnu.org; Tue, 14 Mar 2023 23:07:42 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcHUK-0002ER-8Q for grub-devel@gnu.org; Tue, 14 Mar 2023 23:07:42 -0400 Received: by mail-qv1-xf35.google.com with SMTP id nv15so14625803qvb.7 for ; Tue, 14 Mar 2023 20:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; t=1678849658; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NPP4taLHvH6SIaNMWdfcaPLoPcFFeL8u7P8ZzwMM5MM=; b=a0p84SVkna4iwKS87Enc0nJhntTp7ajB/TIeJSvef1KPXWqfG8UZH3ZOd/cFqxPvyq HrQ5m+g6TiihGGx15kPTUIwYVgOLOCA9fYKZg+pQQtR/J58TQHns5l7Vg0wgF+nGnhRn gznF08s7IiRINzuz09P30qxyB4ro2BdBByYzUlwH1eyhuGTvQrkPhEvp2+9QmyywyAW4 vtVq7EAag9/MIgETHa5fZReWjqr9YGdCTpDNE3TOPL0qgkmTNMprOODcr7KsGD6fJjvI nptY1jMxRZIHmsyhyf+tqccRhSjZcBpcnfujJQ8tlu2zPSBUn1yi/+bA9mqUghFrAAGZ W4LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678849658; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NPP4taLHvH6SIaNMWdfcaPLoPcFFeL8u7P8ZzwMM5MM=; b=RVE0cP4SJPH3iC+IrS7hgdmScVeT43ubFs7zbitumRov/jh7D5GCyy8ONasdspSYBZ zu7YyUkp2FszrLWJnBRO8iBy2zZ8xoNHTKAKyf5G3z+ryWx/sOSgPe6bxGDrlaz6wNT+ ihZfo1MWA9JYpBscyGZEwqS9f3Czc4VBeq1q2DiBnnjU2B3mAhA/qnVdj+xXh+1orkKD kQP40VLma+2ZFFqaEzbKGqBRhlZwhv+bcd+bpwio1pxj6/ZXzkh1i3I2fV8bGtTu8J3a 3adUBmKLmo1SiIjor+6vl5Godyc5co6jrchV7cnLUxkPFyjNOlhfBB0GE0XH6iY5c+mO nQug== X-Gm-Message-State: AO0yUKXqdbngHo6rescA1Xp/dVMjZBnQJsgFWbQZIhudiZ56vknCLTL/ K5zS8HqOpuifhJpnhUmtleCUFDUuibKWBJI2wtwlBQ== X-Google-Smtp-Source: AK7set97J/4UN6P2GkScobzeVdh0oAP1PT76Eq4QzIQD3FQ0Ye76mKxH388NMdetemSHFepECPavOg== X-Received: by 2002:a05:622a:206:b0:3b9:17d7:66f4 with SMTP id b6-20020a05622a020600b003b917d766f4mr68452960qtx.11.1678849658326; Tue, 14 Mar 2023 20:07:38 -0700 (PDT) Received: from [10.41.0.171] ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id c15-20020ac8660f000000b003b86b088755sm2969976qtp.15.2023.03.14.20.07.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Mar 2023 20:07:37 -0700 (PDT) Message-ID: Date: Wed, 15 Mar 2023 03:07:34 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [RFC PATCH] gdb: Add more support for debugging on EFI platforms Content-Language: en-US To: Robbie Harwood , grub-devel@gnu.org, Daniel Kiper Cc: Peter Jones References: <20230227213526.2379718-1-development@efficientek.com> From: Glenn Washburn In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=development@efficientek.com; helo=mail-qv1-xf35.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2023 03:07:43 -0000 On 3/9/23 23:00, Robbie Harwood wrote: > Glenn Washburn writes: > >> If the configure option --enable-efi-debug is given, then enable the >> printing early in EFI startup of the command needed to load symbols for >> the GRUB EFI kernel. This is needed because EFI firmware determines where >> to load the GRUB EFI at runtime, and so the relevant addresses are not >> known ahead of time. This is not printed when secure boot is enabled. >> >> The command is a custom command defined in the gdb_grub GDB script. So >> GDB should be started with the script as an argument to the -x option or >> sourced into an active GDB session before running the outputted command. >> >> Also a command named "gdbinfo" is enabled which allows the user to print >> the gdb command string on-demand, which can be valuable as the printing >> early in EFI startup is quickly replaced by other text. So if using a >> physical screen it may appear too briefly to be registered. >> >> Co-developed-by: Peter Jones >> Signed-off-by: Glenn Washburn >> --- >> This is patch 9 from the v6 "GDB script fixes and improvements" series, with >> one modification. Now the gdbinfo command will print the gdb load command >> even when the configure option is not enabled (though still not when lockdown >> is enabled). >> >> Robbie had 2 concerns with the last patch. >> >> 1. Does this need to be configurable? >> * I responded that this was requested by Daniel because of concerns about >> it breaking silent boot and it seemed reasonable to me, but that I don't >> have a strong opinion. I've left it configurable until Dnaiel weighs in. > > Yeah, I think these concerns are valid. The version in the rhboot tree > gates printing on an env var. Right now, it seems to me that: > > - we want it to be default-off because silent boot I understand you to be talking about a default-off at runtime, not built time. Right now there is a configure option which defaults to off, is this acceptable? > - we want to have the ability to reenable without rebuilding because > secureboot, convenience, etc. This would be great, but how do you propose that this would work? This patch will print very early in EFI init. We can't use GRUB variables. We probably could use EFI variables, but this needs to be well defined (and not by me, since I don't have this requirement). I'm not sure if the GRUB env block is available at this point, but that might be an option. Can you point me to RH's patch you've referred to? Does it meet this requirement, and if so how? Glenn > >> 2. Why should the load command not be printed when secure boot is enabled? >> * This was also requested by Daniel, I assume because of infomation leakage >> that may be a security concern. > > I seem to have also missed Daniel's reply about this earlier, which was: > >>> I think leaking info about the GRUB image addresses on the Secure >>> Boot enabled systems is not the best idea. Or do you think having >>> this feature enabled by default overweight potential dangers coming >>> from its misuse? > > I don't know how these could help an attacker. They'd need access to > console out to retrieve the values, and some way to send input... and > that's basically physical presence: at the very least, if they have > those, I imagine they'd just edit the menu entries, or drop to the grub > shell. > > Do you see a danger here? > > Be well, > --Robbie