[Bug 2037137] [NEW] shim crashes on arm64 w/ firmware that supports EFI Memory Attribute Protocol
dann frazier
2037137 at bugs.launchpad.net
Fri Sep 22 23:12:01 UTC 2023
*** This bug is a duplicate of bug 2036604 ***
https://bugs.launchpad.net/bugs/2036604
Public bug reported:
shim 15.7-0ubuntu1
qemu-efi-aarch64 now implements EFI Memory Attribute Protocol. When shim
detects this, it uses it to set memory attributes appropriately for the
sections of the bootloader image it loads before passing control to it.
After this change, fresh Ubuntu VMs began crashing on startup (bug
2036604):
--------------------------------------
BdsDxe: loading Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
BdsDxe: starting Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
Synchronous Exception at 0x00000000BC300000
Synchronous Exception at 0x00000000BC300000
--------------------------------------
I narrowed this down to only happening when shim executes fbaa64.efi
(thus the fresh VM). I found upstream shim is unaffected, so I used
bisection to identify the relevant change:
From c7b305152802c8db688605654f75e1195def9fd6 Mon Sep 17 00:00:00 2001
From: Nicholas Bishop <REDACTED>
Date: Mon, 19 Dec 2022 18:56:13 -0500
Subject: [PATCH] pe: Align section size up to page size for mem attrs
Setting memory attributes is generally done at page granularity, and
this is enforced by checks in `get_mem_attrs` and
`update_mem_attrs`. But unlike the section address, the section size
isn't necessarily aligned to 4KiB. Round up the section size to fix
this.
Signed-off-by: Nicholas Bishop <nicholasbishop at google.com>
Please add this patch to shim.
** Affects: shim (Ubuntu)
Importance: Undecided
Status: New
** Description changed:
shim 15.7-0ubuntu1
qemu-efi-aarch64 now implements EFI Memory Attribute Protocol. When shim
detects this, it uses it to set memory attributes appropriately for the
sections of the bootloader image it loads before passing control to it.
- After this change, fresh Ubuntu VMs began crashing on startup:
+ After this change, fresh Ubuntu VMs began crashing on startup (bug
+ 2036604):
- --------------------------------------
- BdsDxe: loading Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
- BdsDxe: starting Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
+ --------------------------------------
+ BdsDxe: loading Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
+ BdsDxe: starting Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
+ Synchronous Exception at 0x00000000BC300000
- Synchronous Exception at 0x00000000BC300000
+ Synchronous Exception at 0x00000000BC300000
+ --------------------------------------
- Synchronous Exception at 0x00000000BC300000
+ I narrowed this down to only happening when shim executes fbaa64.efi
+ (thus the fresh VM). I found upstream shim is unaffected, so I used
+ bisection to identify the relevant change:
- --------------------------------------
+ From c7b305152802c8db688605654f75e1195def9fd6 Mon Sep 17 00:00:00 2001
+ From: Nicholas Bishop <REDACTED>
+ Date: Mon, 19 Dec 2022 18:56:13 -0500
+ Subject: [PATCH] pe: Align section size up to page size for mem attrs
+ Setting memory attributes is generally done at page granularity, and
+ this is enforced by checks in `get_mem_attrs` and
+ `update_mem_attrs`. But unlike the section address, the section size
+ isn't necessarily aligned to 4KiB. Round up the section size to fix
+ this.
- I narrowed this down to only happening when shim executes fbaa64.efi (thus the fresh VM). I found upstream shim is unaffected, so I used bisection to identify the relevant change:
-
- From c7b305152802c8db688605654f75e1195def9fd6 Mon Sep 17 00:00:00 2001
- From: Nicholas Bishop <REDACTED>
- Date: Mon, 19 Dec 2022 18:56:13 -0500
- Subject: [PATCH] pe: Align section size up to page size for mem attrs
-
- Setting memory attributes is generally done at page granularity, and
- this is enforced by checks in `get_mem_attrs` and
- `update_mem_attrs`. But unlike the section address, the section size
- isn't necessarily aligned to 4KiB. Round up the section size to fix
- this.
-
- Signed-off-by: Nicholas Bishop <nicholasbishop at google.com>
-
+ Signed-off-by: Nicholas Bishop <nicholasbishop at google.com>
Please add this patch to shim.
** This bug has been marked a duplicate of bug 2036604
Synchronous Exception when booting VMs via qemu-efi-aarch64
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to shim in Ubuntu.
https://bugs.launchpad.net/bugs/2037137
Title:
shim crashes on arm64 w/ firmware that supports EFI Memory Attribute
Protocol
Status in shim package in Ubuntu:
New
Bug description:
shim 15.7-0ubuntu1
qemu-efi-aarch64 now implements EFI Memory Attribute Protocol. When
shim detects this, it uses it to set memory attributes appropriately
for the sections of the bootloader image it loads before passing
control to it. After this change, fresh Ubuntu VMs began crashing on
startup (bug 2036604):
--------------------------------------
BdsDxe: loading Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
BdsDxe: starting Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)
Synchronous Exception at 0x00000000BC300000
Synchronous Exception at 0x00000000BC300000
--------------------------------------
I narrowed this down to only happening when shim executes fbaa64.efi
(thus the fresh VM). I found upstream shim is unaffected, so I used
bisection to identify the relevant change:
From c7b305152802c8db688605654f75e1195def9fd6 Mon Sep 17 00:00:00 2001
From: Nicholas Bishop <REDACTED>
Date: Mon, 19 Dec 2022 18:56:13 -0500
Subject: [PATCH] pe: Align section size up to page size for mem attrs
Setting memory attributes is generally done at page granularity, and
this is enforced by checks in `get_mem_attrs` and
`update_mem_attrs`. But unlike the section address, the section size
isn't necessarily aligned to 4KiB. Round up the section size to fix
this.
Signed-off-by: Nicholas Bishop <nicholasbishop at google.com>
Please add this patch to shim.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shim/+bug/2037137/+subscriptions
More information about the foundations-bugs
mailing list