x86/urgent for v5.11
Hi Linus,
I kinda knew while typing "I hope this is the last batch of x86/urgent updates" last week, Murphy was reading too and uttered "Hold my beer!". So here's more fixes... Thanks Murphy.
Anyway, please pull three more x86/urgent fixes for 5.11 final. We should be finally ready (famous last words). :-)
Thx.
---
The following changes since commit 92bf22614b21a2706f4993b278017e437f7785b3:
Linux 5.11-rc7 (2021-02-07 13:57:38 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tags/x86_urgent_for_v5.11
for you to fetch changes up to 70245f86c109e0eafb92ea9653184c0e44b4b35c:
x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init() (2021-02-10 22:06:47 +0100)
----------------------------------------------------------------
- An SGX use after free fix.
- A fix for the fix to disable CET instrumentation generation for kernel code. We forgot 32-bit, which we seem to do very often nowadays.
- A Xen PV fix to irqdomain init ordering.
----------------------------------------------------------------
Borislav Petkov (1):
x86/build: Disable CET instrumentation in the kernel for 32-bit too
Jarkko Sakkinen (1):
x86/sgx: Maintain encl->refcount for each encl->mm_list entry
Thomas Gleixner (1):
x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init()
arch/x86/Makefile | 6 +++--- arch/x86/kernel/cpu/sgx/driver.c | 3 +++ arch/x86/kernel/cpu/sgx/encl.c | 5 +++++ arch/x86/pci/init.c | 15 +++++++++++---- 4 files changed, 22 insertions(+), 7 deletions(-)
arch/x86/Makefile +3 -3
@@ -50,6 +50,9 @@ export BITS KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow KBUILD_CFLAGS += $(call cc-option,-mno-avx,) +# Intel CET isn't enabled in the kernel +KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) + ifeq ($(CONFIG_X86_32),y) BITS := 32 UTS_MACHINE := i386
@@ -120,9 +123,6 @@ else KBUILD_CFLAGS += -mno-red-zone KBUILD_CFLAGS += -mcmodel=kernel - - # Intel CET isn't enabled in the kernel - KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) endif ifdef CONFIG_X86_X32
arch/x86/kernel/cpu/sgx/driver.c +3 -0
@@ -72,6 +72,9 @@ static int sgx_release(struct inode *inode, struct file *file)synchronize_srcu (&encl->srcu);mmu_notifier_unregister (&encl_mm->mmu_notifier, encl_mm->mm);kfree (encl_mm); + +/* 'encl_mm' is gone, put encl_mm->encl reference: */ +kref_put (&encl->refcount, sgx_encl_release); }kref_put (&encl->refcount, sgx_encl_release);
arch/x86/kernel/cpu/sgx/encl.c +5 -0
@@ -481,6 +481,9 @@ static void sgx_mmu_notifier_free(struct mmu_notifier *mn) { struct sgx_encl_mm *encl_mm = container_of(mn, struct sgx_encl_mm, mmu_notifier); +/* 'encl_mm' is going away, put encl_mm->encl reference: */ +kref_put (&encl_mm->encl->refcount, sgx_encl_release); +kfree (encl_mm); }
@@ -534,6 +537,8 @@ int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm)if (!encl_mm)return -ENOMEM ; +/* Grab a refcount for the encl_mm->encl reference: */ +kref_get (&encl->refcount); encl_mm->encl = encl; encl_mm->mm = mm; encl_mm->mmu_notifier.ops = &sgx_mmu_notifier_ops;
arch/x86/pci/init.c +11 -4
@@ -9,16 +9,23 @@in the right sequence from here. */ static __init int pci_arch_init (void ) { -int type; - -x86_create_pci_msi_domain (); +int type, pcbios =1 ; type =pci_direct_probe ();if (!(pci_probe &PCI_PROBE_NOEARLY ))pci_mmcfg_early_init (); -if (x86_init.pci.arch_init && !x86_init.pci.arch_init ()) +if (x86_init.pci.arch_init) + pcbios = x86_init.pci.arch_init (); + +/* +* Must happen after x86_init.pci.arch_init(). Xen sets up the +* x86_init.irqs.create_pci_msi_domain there. +*/ +x86_create_pci_msi_domain (); + +if (!pcbios)return 0 ;pci_pcbios_init ();
Signature · 4 lines
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG NürnbergThe pull request you sent on Sun, 14 Feb 2021 11:34:14 +0100:
The pull request you sent on Sun, 14 Feb 2021 11:34:14 +0100:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gittags/x86_urgent_for_v5.11
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/c553021498640050340924bd62fa580e253467ac
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html