efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted

Bug #1814982 reported by mahmoh
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Paolo Pisati
Bionic
Fix Released
Undecided
Paolo Pisati
Cosmic
Fix Released
Undecided
Paolo Pisati
Disco
Fix Released
Undecided
Paolo Pisati

Bug Description

[Impact]
The Ubuntu kernel is not currently bootable on various arm64 laptops (HP Envy x2, Asus NovaGo, Lenovo Miix 630, Lenovo Yoga C630, Samsung ...) because of EFI memory permissions/restrictions. The reason is explained in the commit supplied below.

[Test Case]
Install and boot Ubuntu on one of the above arm64 laptops.

[Fix]
Committed upstream: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=4e46c2a956215482418d7b315749fb1b6c6bc224

[Regression Risk]
This commit adds support for an optional kernel command line parameter so there is minimal to no risk.

mahmoh (mahmoh)
affects: grub2 (Ubuntu) → linux (Ubuntu)
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1814982

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
mahmoh (mahmoh) wrote :

I am unable to provide apport logs due to the nature of the problem (kernel hang on boot before console logging).

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
tags: added: ubuntu-on-arm
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu Bionic):
status: New → Confirmed
Changed in linux (Ubuntu Cosmic):
status: New → Confirmed
mahmoh (mahmoh)
tags: added: arm64
Paolo Pisati (p-pisati)
Changed in linux (Ubuntu Bionic):
assignee: nobody → Paolo Pisati (p-pisati)
Changed in linux (Ubuntu Cosmic):
assignee: nobody → Paolo Pisati (p-pisati)
Changed in linux (Ubuntu Disco):
assignee: nobody → Paolo Pisati (p-pisati)
Revision history for this message
Paolo Pisati (p-pisati) wrote :

I'm fine with the patch itself, but I don't have access to any of these laptops - could you test any of these kernels and tell me if they fix your boot issue?

http://people.canonical.com/~ppisati/lp1814982/

and here is the src code (for bionic):

https://git.launchpad.net/~p-pisati/ubuntu/+source/linux/log/?h=b-master-lp1814982

Revision history for this message
mahmoh (mahmoh) wrote :

Snapdragon 835 Laptop Results:

4.15 boots to the first 4 lines before kernel
4.18 boots most of the kernel, stops for a bit, then suffers with an rshed crash
5.0 boots to the end of the kernel log, then the screen goes blank

Without this patch on the 835 laptops the user sees grub and then nothing and is left sad; however, with this patch the user sees some form of kernel life on the laptops and is left hopeful - which leads them to start looking around for fixes and help with the solution.

Additional patches will need to be backported but without this patch it's a non-starter until 5.1 or after.

If there is little to no regression risk as this adds a kernel parameter and this is required to enable these platforms to boot, if not other platforms, I would argue to include the patch for at least Disco if not Bionic since random people will attempt to boot the LTS release. Thank you for building the test kernel.

Revision history for this message
Paolo Pisati (p-pisati) wrote :

Newer kernels with the above patch, i would appreciate if you could give it a shot:

linux-buildinfo-4.15.0-1048-snapdragon-edge_4.15.0-1048.51~lp1814982_arm64.deb
linux-headers-4.15.0-1048-snapdragon-edge_4.15.0-1048.51~lp1814982_arm64.deb
linux-image-4.15.0-1048-snapdragon-edge_4.15.0-1048.51~lp1814982_arm64.deb
linux-modules-4.15.0-1048-snapdragon-edge_4.15.0-1048.51~lp1814982_arm64.deb

Revision history for this message
Lee Jones (lag) wrote :

Good afternoon Paolo. It's been a while. I hope you and the team are well.

How much extra enablement for the Snapdragon 835does 'snapdragon-edge' contain?

My fear is that a lot of the most recent functionally patches have either only just gone upstream, or are currently residing in -next. In order to have a kernel which is useful, these patches would be required.

I tested the kernels you posted before. mahmoh posted the results of my testing above. v5.0 gets really close, but the screen goes blank right at the last moment and no login screen is presented. My gut feeling tells me that this is an issue surrounding regulators. There are some patches in -next which tune some of the QCom regulator drivers which I believe will solve the problem.

The patch you are testing works (and is actually a hard requirement for all of these devices). As mahmoh mentioned, if it wasn't working the kernels above wouldn't get much past the Grub screen. Obviously once v5.1-rc1 is released we get all our requirements for free, but it would be really nice if you guys could carry the patch in your most recent kernels until you pick up v5.1.

Thanks again Paolo.

Seth Forshee (sforshee)
Changed in linux (Ubuntu Disco):
status: Confirmed → Fix Committed
Changed in linux (Ubuntu Bionic):
status: Confirmed → Fix Committed
Changed in linux (Ubuntu Cosmic):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 5.0.0-7.8

---------------
linux (5.0.0-7.8) disco; urgency=medium

  * linux: 5.0.0-7.8 -proposed tracker (LP: #1818519)

  * Packaging resync (LP: #1786013)
    - [Packaging] update helper scripts

  * unnecessary request_queue freeze (LP: #1815733)
    - block: avoid setting nr_requests to current value
    - block: avoid setting none scheduler if it's already none

  * Miscellaneous Ubuntu changes
    - SAUCE: selftests: net: Don't fail test_vxlan_under_vrf on xfail
    - update dkms package versions

  [ Upstream Kernel Changes ]

  * Rebase to v5.0

 -- Seth Forshee <email address hidden> Mon, 04 Mar 2019 08:46:10 -0600

Changed in linux (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-cosmic' to 'verification-done-cosmic'. If the problem still exists, change the tag 'verification-needed-cosmic' to 'verification-failed-cosmic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-cosmic
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Revision history for this message
mahmoh (mahmoh) wrote :

bionic linux-image-4.15.0-47-generic:

- Tested with and without efi=novamap and didn't get past the EFI stub messages.

cosmic linux-image-4.18.0-17-generic:

- Tested with efi=novamap and the kernel booted and got quite far but then went blank, as expected but this is a good start; without efi=novamap it didn't get past the EFI stub messages.

disco linux-image-5.0.0-8.9-generic:

- Tested this one for fun, oddly this kernel did worse than 4.18 and didn't get past the kernel stubs either!

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
mahmoh (mahmoh) wrote :

Note: if the point release installers will pick up the 4.18 series kernel with the fix then I think a fix for cosmic will suffice vs. bionic also given the results.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (25.4 KiB)

This bug was fixed in the package linux - 4.15.0-47.50

---------------
linux (4.15.0-47.50) bionic; urgency=medium

  * linux: 4.15.0-47.50 -proposed tracker (LP: #1819716)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync getabis
    - [Packaging] update helper scripts
    - [Packaging] resync retpoline extraction

  * C++ demangling support missing from perf (LP: #1396654)
    - [Packaging] fix a mistype

  * arm-smmu-v3 arm-smmu-v3.3.auto: CMD_SYNC timeout (LP: #1818162)
    - iommu/arm-smmu-v3: Fix unexpected CMD_SYNC timeout

  * Crash in nvme_irq_check() when using threaded interrupts (LP: #1818747)
    - nvme-pci: fix out of bounds access in nvme_cqe_pending

  * CVE-2019-9213
    - mm: enforce min addr even if capable() in expand_downwards()

  * CVE-2019-3460
    - Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt

  * amdgpu with mst WARNING on blanking (LP: #1814308)
    - drm/amd/display: Don't use dc_link in link_encoder
    - drm/amd/display: Move wait for hpd ready out from edp power control.
    - drm/amd/display: eDP sequence BL off first then DP blank.
    - drm/amd/display: Fix unused variable compilation error
    - drm/amd/display: Fix warning about misaligned code
    - drm/amd/display: Fix MST dp_blank REG_WAIT timeout

  * tun/tap: unable to manage carrier state from userland (LP: #1806392)
    - tun: implement carrier change

  * CVE-2019-8980
    - exec: Fix mem leak in kernel_read_file

  * raw_skew in timer from the ubuntu_kernel_selftests failed on Bionic
    (LP: #1811194)
    - selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock
      adjustments are in progress

  * [Packaging] Allow overlay of config annotations (LP: #1752072)
    - [Packaging] config-check: Add an include directive

  * CVE-2019-7308
    - bpf: move {prev_,}insn_idx into verifier env
    - bpf: move tmp variable into ax register in interpreter
    - bpf: enable access to ax register also from verifier rewrite
    - bpf: restrict map value pointer arithmetic for unprivileged
    - bpf: restrict stack pointer arithmetic for unprivileged
    - bpf: restrict unknown scalars of mixed signed bounds for unprivileged
    - bpf: fix check_map_access smin_value test when pointer contains offset
    - bpf: prevent out of bounds speculation on pointer arithmetic
    - bpf: fix sanitation of alu op with pointer / scalar type from different
      paths
    - bpf: add various test cases to selftests

  * CVE-2017-5753
    - bpf: properly enforce index mask to prevent out-of-bounds speculation
    - bpf: fix inner map masking to prevent oob under speculation

  * BPF: kernel pointer leak to unprivileged userspace (LP: #1815259)
    - bpf/verifier: disallow pointer subtraction

  * squashfs hardening (LP: #1816756)
    - squashfs: more metadata hardening
    - squashfs metadata 2: electric boogaloo
    - squashfs: more metadata hardening
    - Squashfs: Compute expected length from inode size rather than block length

  * efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted (LP: #1814982)
    - efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted

  * Update ENA driver to version 2.0.3K (LP: #1816806)...

Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.0 KiB)

This bug was fixed in the package linux - 4.18.0-17.18

---------------
linux (4.18.0-17.18) cosmic; urgency=medium

  * linux: 4.18.0-17.18 -proposed tracker (LP: #1819624)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync getabis
    - [Packaging] update helper scripts

  * C++ demangling support missing from perf (LP: #1396654)
    - [Packaging] fix a mistype

  * arm-smmu-v3 arm-smmu-v3.3.auto: CMD_SYNC timeout (LP: #1818162)
    - iommu/arm-smmu-v3: Fix unexpected CMD_SYNC timeout

  * Crash in nvme_irq_check() when using threaded interrupts (LP: #1818747)
    - nvme-pci: fix out of bounds access in nvme_cqe_pending

  * CVE-2019-9003
    - ipmi: fix use-after-free of user->release_barrier.rda

  * CVE-2019-9162
    - netfilter: nf_nat_snmp_basic: add missing length checks in ASN.1 cbs

  * CVE-2019-9213
    - mm: enforce min addr even if capable() in expand_downwards()

  * CVE-2019-3460
    - Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt

  * tun/tap: unable to manage carrier state from userland (LP: #1806392)
    - tun: implement carrier change

  * CVE-2019-8980
    - exec: Fix mem leak in kernel_read_file

  * [Packaging] Allow overlay of config annotations (LP: #1752072)
    - [Packaging] config-check: Add an include directive

  * amdgpu with mst WARNING on blanking (LP: #1814308)
    - drm/amd/display: Fix MST dp_blank REG_WAIT timeout

  * CVE-2019-7308
    - bpf: move {prev_,}insn_idx into verifier env
    - bpf: move tmp variable into ax register in interpreter
    - bpf: enable access to ax register also from verifier rewrite
    - bpf: restrict map value pointer arithmetic for unprivileged
    - bpf: restrict stack pointer arithmetic for unprivileged
    - bpf: restrict unknown scalars of mixed signed bounds for unprivileged
    - bpf: fix check_map_access smin_value test when pointer contains offset
    - bpf: prevent out of bounds speculation on pointer arithmetic
    - bpf: fix sanitation of alu op with pointer / scalar type from different
      paths
    - bpf: add various test cases to test_verifier
    - bpf: add various test cases to selftests

  * CVE-2017-5753
    - bpf: fix inner map masking to prevent oob under speculation

  * Use memblock quirk instead of delayed allocation for GICv3 LPI tables
    (LP: #1816425)
    - efi/arm: Revert "Defer persistent reservations until after paging_init()"
    - arm64, mm, efi: Account for GICv3 LPI tables in static memblock reserve
      table

  * efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted (LP: #1814982)
    - efi/arm/arm64: Allow SetVirtualAddressMap() to be omitted

  * Update ENA driver to version 2.0.3K (LP: #1816806)
    - net: ena: update driver version from 2.0.2 to 2.0.3
    - net: ena: fix race between link up and device initalization
    - net: ena: fix crash during failed resume from hibernation

  * Silent "Unknown key" message when pressing keyboard backlight hotkey
    (LP: #1817063)
    - platform/x86: dell-wmi: Ignore new keyboard backlight change event

  * CVE-2018-19824
    - ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c

  * CVE-2019-3459
    - Bluetooth: Verify that l2cap_get...

Read more...

Changed in linux (Ubuntu Cosmic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.