Re: [PATCH v5 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items

2022-06-10 Thread Jason Andryuk
On Thu, Jun 9, 2022 at 2:50 PM Mathieu Desnoyers
 wrote:
>
> The current implementation of the 20_linux_xen script implements its
> menu items sorting in bash with a quadratic algorithm, calling "sed",
> "sort", "head", and "grep" to compare versions between individual lines,
> which is annoyingly slow for kernel developers who can easily end up
> with 50-100 kernels in their boot partition.
>
> This fix is ported from the 10_linux script, which has a similar
> quadratic code pattern.
>
> [ Note: this is untested. I would be grateful if anyone with a Xen
>   environment could test it before it is merged. ]

Hi, Mathieu,

I tested by manually applying patch 2/5 on top of Fedora 36's
installed /etc/grub.d/20_linux_xen, and manually applying patch 1/5 to
/usr/share/grub/grub-mkconfig_lib.  It seems to generate grub.cfg
menuentry-ies in the correct order.

Note for patch 1/5, it's best practice to use "$@" with the double
quotes to prevent word splitting of arguments.  Doesn't really matter
for that function at this time though.

Regards,
Jason

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


GRUB 2.12 release, etc.

2022-06-10 Thread Daniel Kiper
Hi,

I am going to release GRUB 2.12 around October 2022. I will publish
exact dates closer to the release and at least month before freeze date.
If you think some features and fixes should land in the GRUB 2.12 please
replay to this email.

I am not going to release any of earlier released versions with recent
security fixes on top of them. Though if somebody wants to step up and
prepare them I am happy to create relevant branch in the GRUB git repository.

Daniel

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: Linux DRTM on UEFI platforms

2022-06-10 Thread Ard Biesheuvel
On Thu, 19 May 2022 at 22:59, Daniel P. Smith
 wrote:
>
>
> Greetings,
>
> Based on the discussions that occurred in this thread, there seems to be
> two issues at hand that should be decoupled, as their solutions can and
> should be implemented independently. These are:
> - the handling of the Dynamic Launch preamble
> - providing the complete kernel configuration for measurement
>
> For the former, it is believed there is a consensus that Matthew's
> proposed callback approach would be the preferred method. Through some
> contemplating and prototyping, the determination is that this will in
> fact be an approach that will ultimately benefit the TrenchBoot project
> itself.
>
> In general, the preamble consists of two activities: 1. preparing the
> contents in memory and 2. preparing the hardware in order to call the
> Dynamic Launch instruction. In past implementations, these two
> activities were conducted sequentially, but in reality the time delta
> between the two may be arbitrary. Introducing this separation does not
> introduce any security concerns due to how the Dynamic Launch works. Any
> tampering of the contents in memory will either cause the Dynamic Launch
> to fail or result in a detectable difference in the Dynamic Launch
> measurement chain.
>
> In order to separate the hardware interactions into what will be called
> the DLE Handler, this will require a collection of information regarding
> how the environment is set up. When working through what would be
> required, this led to the realization that this really should be
> generalized into a formal specification for TrenchBoot's Secure Launch.
> This will enable a reusable solution for the TrenchBoot project, versus
> implementing a one-off solution for Linux. A prototype of is near
> completion, for which below is a visual depiction along with a
> step-by-step walk through of how it would work for efi-stub.
>
> Secure Launch Flow:
>
>  +-+
>  | |
>  +-->| Secure Launch   +---+
>  |   | Resource Table  |   |
>  |   | |+--|---+
>  |   +++|  | DLME  |
>  || |  v   |
>  || | +---+|
>+-+-+  v | |   ||
> +--+-+ |   +-+  | | Secure Launch ||
> || +-->| +--->| Entry ||
> | Bootloader(s)  | |   | DLE Handler |  | |   ||
> |+-+   | |  | +---+|
> ++ +-+  +--+
>
> A quick note on the flow diagram, for simplicity all entities prior to
> the DLE Handler are represented by the "Bootloader(s)" block due to the
> fact that what entities are involved can and will vary. This is where
> both GRUB and efi-stub are being represented even though for Linux EFI,
> GRUB is considered the bootmanager while efi-stub is the bootloader.
>
> An efi-stub walk-thru:
>
> 1. - GRUB
> 1.1 - GRUB will initialize the Secure Launch Resource Table (SLRT)
> 1.2 - GRUB will set up DLE Handler and register it in SLRT
> 1.5 - GRUB will load Linux kernel
> 1.3 - GRUB will set up DL environment appropriately for HW platform
> 1.4 - GRUB will record DL setup in SLRT
> 1.5 - GRUB will record SLRT location in platform's DL config structure
> 1.5 - GRUB will register SLRT in EFI configuration table under SL GUID
> 1.6 - GRUB will invoke efi-stub
>
> 2. - efi-stub
> 2.1 - efi-stub will check if SL GUID is in EFI configuration table
> 2.2 - for each efi-stub config action, an SLRT EFI config event will be
>   recorded
> 2.3 - efi-stub calls EBS() then jumps to DLE Handler registered in SLRT
>   while passing the SLRT address
>
> 3. - DL Handler
> 3.1 - DL Handler will retrieve SL Entry from SLRT
> 3.2 - DL Handler will prepare HW for calling DL CPU instruction
> 3.3 - DL Handler will execute DL CPU instruction
>
> 4. SL Entry
> 4.1 SL Entry will retrieve SLRT address from platform's DL config struct
> 4.2 SL Entry will use policy in SLRT to determine what to measure
> 4.3 SL Entry will set up HW to what Linux expects
> 4.4 SL Entry will jump into Linux setup kernel
> 4.5 SL Entry will record measurements into TPM prior to init process
> starting
>
> While Matthew's original proposal was around having a location in the
> efi-stub for the callback to be registered, it is felt that it would be
> better suited as part of the Secure Launch specification. What is
> proposed is for the address of the DL Handler to be stored in the SLRT,
> details for the SLRT are below. Then the bootloader that is responsible
> for loading the DL Handler will regi