Support importing mokx keys into revocation list from the mok table
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
New
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
linux-azure-5.8 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Invalid
|
Undecided
|
Unassigned | ||
linux-hwe-5.8 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Committed
|
Medium
|
Unassigned | ||
Hirsute |
Invalid
|
Undecided
|
Unassigned | ||
linux-oem-5.10 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Ubuntu's 15.4 based shim ships a very large vendor-dbx (aka mokx) which revokes many Ubuntu kernel hashes and 2012 signing key.
* Kernel should import those into it's %:.blacklist keyring such that it prohibits signed kexec of the revoked kernels.
* v5.13-rc1 kernel has learned how to import mokx and how to import full certs into the %:.blacklist keyring.
* However, it only does so by reading MokListXRT efi variable.
* Due to the large size of Ubuntu's vendor-dbx, shim does not create MokListXRT efi variable, but instead creates MokListXRT1 MokListXRT2 MokListXRT3 which currently v5.13-rc1 kernel cannot read. Shim also exposes MokListXRT via mokvar table, which is easier to parse and contains all the revocations in full. Kernel needs a patch to read MokListXRT via mokvar table.
* We have two options on how to proceed from here, either we include the same hashes and certs as our vendordbx in in the kernel as revocation list, or we fix kernel to read MokListXRT via mokvar table
* The above is known as CVE-2020-26541
* Separately it would be nice to add informational dmesg messages when revoking signing certificates, as a good indication that signing key rotation events have happened and have been applied correctly.
[Test Plan]
* Boot kernel with 15.4 based Ubuntu shim
* Install keyutils package
* Execute $ sudo keyctl list %:.blacklist it should list in exccess of 300+ hash entries. It also must list assymetric Canonical signing key from 2012.
* Separately check dmesg to observe that asymmetric canonical signing key from 2012 is revoked.
* $ sudo ls /sys/firmware/
MokListRT MokListXRT SbatLevelRT
When booted with shim, the mok-variables directory above should exist, and contain at least `MokListRT MokListXRT SbatLevelRT` files.
In kernel messages, the CA certificate should be loaded via MOKvar table i.e:
* $ sudo journalctl -b -k | grep -A1 'MOKvar table'
Sep 27 13:11:04 champion-spaniel kernel: integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
Sep 27 13:11:04 champion-spaniel kernel: integrity: Loaded X.509 cert 'Canonical Ltd. Master Certificate Authority: ad91990bc22ab1f
[Where problems could occur]
* EFI variable storage can be full thus preventing shim to mirror efivars and the moktable. On decent hardware this should not happen, but has been observed to be corrupted on some older EDKII based OVMF instances with small EFI variable storage space (pre-4MB).
[Other Info]
* The patches to fix the above have been submitted upstream
https://<email address hidden>/
https://<email address hidden>/
This will now be submitted as SAUCE patches for the Ubuntu UNSTABLE kernel, until accepted upstream.
Related branches
- Ubuntu Kernel Repositories: Pending requested
-
Diff: 4122 lines (+1416/-495)127 files modifiedMakefile (+1/-1)
arch/arc/Kconfig (+1/-0)
arch/arc/include/asm/syscalls.h (+1/-0)
arch/arc/include/uapi/asm/unistd.h (+1/-0)
arch/arc/kernel/entry.S (+12/-0)
arch/arc/kernel/process.c (+3/-4)
arch/arc/kernel/sys.c (+1/-0)
arch/arc/kernel/vmlinux.lds.S (+2/-0)
arch/arm/kernel/Makefile (+5/-1)
arch/arm/kernel/return_address.c (+0/-4)
arch/arm64/boot/dts/qcom/msm8994-angler-rev-101.dts (+4/-0)
arch/parisc/include/asm/string.h (+0/-15)
arch/parisc/kernel/parisc_ksyms.c (+0/-4)
arch/parisc/lib/Makefile (+2/-2)
arch/parisc/lib/memset.c (+72/-0)
arch/powerpc/boot/crt0.S (+0/-3)
arch/x86/events/amd/ibs.c (+8/-0)
arch/x86/events/amd/iommu.c (+26/-21)
arch/x86/events/amd/power.c (+1/-0)
arch/x86/events/intel/pt.c (+1/-1)
arch/x86/events/intel/uncore_snbep.c (+1/-1)
arch/x86/kernel/reboot.c (+2/-1)
arch/x86/kernel/setup.c (+1/-0)
arch/x86/kvm/mmu.c (+9/-1)
arch/x86/platform/efi/efi.c (+3/-0)
arch/xtensa/Kconfig (+1/-1)
certs/.gitignore (+1/-0)
certs/Kconfig (+8/-0)
certs/Makefile (+17/-2)
certs/blacklist.c (+24/-0)
certs/common.c (+1/-0)
certs/revocation_certificates.S (+21/-0)
debian.master/config/annotations (+1/-0)
debian.master/config/config.common.ubuntu (+1/-0)
debian.master/upstream-stable (+1/-1)
debian/revoked-certs/canonical-uefi-2012-all.pem (+86/-0)
debian/rules (+13/-1)
dev/null (+0/-136)
drivers/block/Kconfig (+2/-2)
drivers/block/cryptoloop.c (+2/-0)
drivers/block/floppy.c (+13/-14)
drivers/firmware/efi/Makefile (+1/-0)
drivers/firmware/efi/arm-init.c (+1/-0)
drivers/firmware/efi/efi.c (+6/-0)
drivers/firmware/efi/mokvar-table.c (+362/-0)
drivers/gpu/drm/drm_ioc32.c (+1/-3)
drivers/gpu/drm/i915/gt/intel_timeline.c (+8/-0)
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c (+1/-1)
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h (+1/-0)
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c (+9/-0)
drivers/gpu/ipu-v3/ipu-cpmem.c (+15/-15)
drivers/infiniband/hw/bnxt_re/ib_verbs.c (+1/-0)
drivers/infiniband/hw/efa/efa_main.c (+1/-0)
drivers/infiniband/hw/hfi1/sdma.c (+4/-5)
drivers/media/usb/stkwebcam/stk-webcam.c (+4/-2)
drivers/mmc/host/sdhci-msm.c (+18/-0)
drivers/net/can/usb/esd_usb2.c (+2/-2)
drivers/net/dsa/mt7530.c (+1/-4)
drivers/net/ethernet/apm/xgene-v2/main.c (+3/-1)
drivers/net/ethernet/cadence/macb_ptp.c (+10/-1)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h (+3/-0)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c (+2/-11)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c (+31/-1)
drivers/net/ethernet/intel/e1000e/ich8lan.c (+13/-1)
drivers/net/ethernet/intel/e1000e/ich8lan.h (+3/-0)
drivers/net/ethernet/marvell/mvneta.c (+1/-1)
drivers/net/ethernet/qlogic/qed/qed_ll2.c (+20/-0)
drivers/net/ethernet/qlogic/qed/qed_main.c (+6/-1)
drivers/net/ethernet/qlogic/qed/qed_rdma.c (+1/-2)
drivers/net/ethernet/qlogic/qede/qede_main.c (+1/-1)
drivers/net/ethernet/realtek/r8169_main.c (+1/-0)
drivers/net/ethernet/xilinx/ll_temac_main.c (+1/-3)
drivers/opp/of.c (+3/-2)
drivers/pci/quirks.c (+6/-6)
drivers/reset/reset-zynqmp.c (+2/-1)
drivers/scsi/scsi_sysfs.c (+6/-3)
drivers/tty/vt/vt_ioctl.c (+7/-4)
drivers/usb/dwc3/gadget.c (+11/-12)
drivers/usb/gadget/function/u_audio.c (+2/-3)
drivers/usb/host/xhci-debugfs.c (+4/-2)
drivers/usb/host/xhci-rcar.c (+7/-0)
drivers/usb/host/xhci-trace.h (+4/-4)
drivers/usb/host/xhci.h (+28/-24)
drivers/usb/mtu3/mtu3_gadget.c (+2/-4)
drivers/usb/serial/ch341.c (+0/-1)
drivers/usb/serial/mos7720.c (+3/-1)
drivers/usb/serial/option.c (+2/-0)
drivers/vhost/vringh.c (+1/-1)
drivers/virtio/virtio_pci_common.c (+7/-0)
drivers/virtio/virtio_ring.c (+4/-2)
fs/btrfs/btrfs_inode.h (+15/-0)
fs/btrfs/file.c (+2/-8)
fs/btrfs/inode.c (+2/-4)
fs/btrfs/transaction.h (+1/-1)
fs/btrfs/volumes.c (+1/-1)
fs/crypto/hooks.c (+44/-0)
fs/ext4/symlink.c (+10/-1)
fs/f2fs/namei.c (+10/-1)
fs/overlayfs/export.c (+1/-1)
fs/proc/base.c (+10/-1)
fs/ubifs/file.c (+11/-1)
include/linux/efi.h (+34/-0)
include/linux/fscrypt.h (+7/-0)
include/linux/netdevice.h (+4/-0)
include/linux/once.h (+2/-2)
include/linux/oom.h (+2/-2)
kernel/audit_tree.c (+1/-1)
kernel/bpf/verifier.c (+55/-2)
kernel/kthread.c (+29/-14)
kernel/sched/fair.c (+1/-1)
lib/once.c (+8/-3)
mm/oom_kill.c (+10/-12)
mm/page_alloc.c (+4/-4)
net/core/rtnetlink.c (+2/-1)
net/ipv4/icmp.c (+21/-2)
net/ipv4/igmp.c (+2/-0)
net/ipv4/ip_gre.c (+2/-0)
net/netfilter/nf_conntrack_core.c (+22/-49)
net/qrtr/qrtr.c (+1/-1)
net/rds/ib_frmr.c (+2/-2)
net/socket.c (+5/-1)
scripts/Makefile (+1/-0)
security/integrity/platform_certs/keyring_handler.c (+1/-0)
security/integrity/platform_certs/load_uefi.c (+101/-37)
sound/core/pcm_lib.c (+1/-1)
sound/pci/hda/patch_realtek.c (+10/-0)
sound/usb/quirks.c (+1/-0)
summary: |
- Supporting importing dbx keys into revocation list from mok table + Support importing mokx keys into revocation list from the mok table |
information type: | Public → Public Security |
Changed in linux (Ubuntu): | |
status: | New → Confirmed |
Changed in linux (Ubuntu Hirsute): | |
status: | New → Fix Committed |
Changed in linux-oem-5.10 (Ubuntu Xenial): | |
status: | New → Invalid |
Changed in linux-oem-5.10 (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in linux-oem-5.10 (Ubuntu Focal): | |
status: | New → Fix Committed |
Changed in linux-oem-5.10 (Ubuntu Hirsute): | |
status: | New → Invalid |
Changed in linux-oem-5.10 (Ubuntu): | |
status: | New → Invalid |
description: | updated |
Changed in linux-azure-5.8 (Ubuntu Hirsute): | |
status: | New → Invalid |
Changed in linux-azure-5.8 (Ubuntu): | |
status: | New → Invalid |
Changed in linux-azure-5.8 (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in linux-azure-5.8 (Ubuntu Xenial): | |
status: | New → Invalid |
Changed in linux-hwe-5.8 (Ubuntu Xenial): | |
status: | New → Invalid |
Changed in linux-hwe-5.8 (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in linux-hwe-5.8 (Ubuntu Hirsute): | |
status: | New → Invalid |
Changed in linux-hwe-5.8 (Ubuntu Focal): | |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux (Ubuntu Focal): | |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux-hwe-5.8 (Ubuntu): | |
status: | New → Invalid |
Changed in linux-hwe-5.8 (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Bionic): | |
status: | New → Fix Committed |
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- focal' to 'verification- done-focal' . If the problem still exists, change the tag 'verification- needed- focal' to 'verification- failed- focal'.
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!