CVE-2024-41096

Updated on 29 Jul 2024

Severity

7.8 High severity

Details

CVSS score
7.8
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Overview

About vulnerability

In the Linux kernel, the following vulnerability has been resolved:

PCI/MSI: Fix UAF in msi_capability_init

KFENCE reports the following UAF:

BUG: KFENCE: use-after-free read in __pci_enable_msi_range+0x2c0/0x488

Use-after-free read at 0x0000000024629571 (in kfence-#12): __pci_enable_msi_range+0x2c0/0x488 pci_alloc_irq_vectors_affinity+0xec/0x14c pci_alloc_irq_vectors+0x18/0x28

kfence-#12: 0x0000000008614900-0x00000000e06c228d, size=104, cache=kmalloc-128

allocated by task 81 on cpu 7 at 10.808142s: __kmem_cache_alloc_node+0x1f0/0x2bc kmalloc_trace+0x44/0x138 msi_alloc_desc+0x3c/0x9c msi_domain_insert_msi_desc+0x30/0x78 msi_setup_msi_desc+0x13c/0x184 __pci_enable_msi_range+0x258/0x488 pci_alloc_irq_vectors_affinity+0xec/0x14c pci_alloc_irq_vectors+0x18/0x28

freed by task 81 on cpu 7 at 10.811436s: msi_domain_free_descs+0xd4/0x10c msi_domain_free_locked.part.0+0xc0/0x1d8 msi_domain_alloc_irqs_all_locked+0xb4/0xbc pci_msi_setup_msi_irqs+0x30/0x4c __pci_enable_msi_range+0x2a8/0x488 pci_alloc_irq_vectors_affinity+0xec/0x14c pci_alloc_irq_vectors+0x18/0x28

Descriptor allocation done in: __pci_enable_msi_range msi_capability_init msi_setup_msi_desc msi_insert_msi_desc msi_domain_insert_msi_desc msi_alloc_desc …

Freed in case of failure in __msi_domain_alloc_locked() __pci_enable_msi_range msi_capability_init pci_msi_setup_msi_irqs msi_domain_alloc_irqs_all_locked msi_domain_alloc_locked __msi_domain_alloc_locked => fails msi_domain_free_locked …

That failure propagates back to pci_msi_setup_msi_irqs() in msi_capability_init() which accesses the descriptor for unmasking in the error exit path.

Cure it by copying the descriptor and using the copy for the error exit path unmask operation.

[ tglx: Massaged change log ]

Details

Fixes

KernelCare state

Live-patch status from KernelCare for each operating system.

Operating system Status Covered kernels
AlmaLinux 9 Released
29 kernels
  • 5.14.0-162.12.1.el9_1
  • 5.14.0-162.18.1.el9_1
  • 5.14.0-162.22.2.el9_1
  • 5.14.0-162.23.1.el9_1
  • 5.14.0-162.6.1.el9_1
  • 5.14.0-284.11.1.el9_2
  • 5.14.0-284.18.1.el9_2
  • 5.14.0-284.25.1.el9_2
  • 5.14.0-284.30.1.el9_2
  • 5.14.0-362.13.1.el9_3
  • 5.14.0-362.18.1.el9_3
  • 5.14.0-362.24.1.el9_3
  • 5.14.0-362.24.2.el9_3
  • 5.14.0-362.8.1.el9_3
  • 5.14.0-427.13.1.el9_4
  • 5.14.0-427.16.1.el9_4
  • 5.14.0-427.18.1.el9_4
  • 5.14.0-427.20.1.el9_4
  • 5.14.0-427.22.1.el9_4
  • 5.14.0-427.24.1.el9_4
  • 5.14.0-427.26.1.el9_4
  • 5.14.0-427.28.1.el9_4
  • 5.14.0-427.31.1.el9_4
  • 5.14.0-427.33.1.el9_4
  • 5.14.0-70.13.1.el9_0
  • 5.14.0-70.17.1.el9_0
  • 5.14.0-70.22.1.el9_0
  • 5.14.0-70.26.1.el9_0
  • 5.14.0-70.30.1.el9_0
Amazon Linux 2023 Planned
Debian 12 Released
16 kernels
  • 6.1.106-3
  • 6.1.27-1
  • 6.1.38-1
  • 6.1.38-2
  • 6.1.38-4
  • 6.1.52-1
  • 6.1.55-1
  • 6.1.64-1
  • 6.1.66-1
  • 6.1.67-1
  • 6.1.69-1
  • 6.1.76-1
  • 6.1.85-1
  • 6.1.90-1
  • 6.1.94-1
  • 6.1.99-1
Oracle Linux 9 Released
35 kernels
  • 5.14.0-162.12.1.el9_1
  • 5.14.0-162.18.1.el9_1
  • 5.14.0-162.22.2.el9_1
  • 5.14.0-162.23.1.el9_1
  • 5.14.0-162.6.1.el9_1
  • 5.14.0-284.11.1.el9_2
  • 5.14.0-284.18.1.el9_2
  • 5.14.0-284.25.1.0.1.el9_2
  • 5.14.0-284.25.1.el9_2
  • 5.14.0-284.30.0.1.el9_2
  • 5.14.0-284.30.1.el9_2
  • 5.14.0-362.13.0.1.el9_3
  • 5.14.0-362.13.1.el9_3
  • 5.14.0-362.18.0.1.el9_3
  • 5.14.0-362.18.0.2.el9_3
  • 5.14.0-362.18.1.el9_3
  • 5.14.0-362.24.1.0.1.el9_3
  • 5.14.0-362.24.1.0.2.el9_3
  • 5.14.0-362.24.1.el9_3
  • 5.14.0-362.8.1.el9_3
  • 5.14.0-427.13.1.el9_4
  • 5.14.0-427.16.1.el9_4
  • 5.14.0-427.18.1.el9_4
  • 5.14.0-427.20.1.el9_4
  • 5.14.0-427.22.1.el9_4
  • 5.14.0-427.24.1.el9_4
  • 5.14.0-427.26.1.el9_4
  • 5.14.0-427.28.1.el9_4
  • 5.14.0-427.31.1.el9_4
  • 5.14.0-427.33.1.el9_4
  • 5.14.0-70.13.1.0.3.el9_0
  • 5.14.0-70.17.1.0.1.el9_0
  • 5.14.0-70.22.1.0.1.el9_0
  • 5.14.0-70.26.1.0.1.el9_0
  • 5.14.0-70.30.1.0.1.el9_0
RHEL 9 Released
29 kernels
  • 5.14.0-162.12.1.el9_1
  • 5.14.0-162.18.1.el9_1
  • 5.14.0-162.22.2.el9_1
  • 5.14.0-162.23.1.el9_1
  • 5.14.0-162.6.1.el9_1
  • 5.14.0-284.11.1.el9_2
  • 5.14.0-284.18.1.el9_2
  • 5.14.0-284.25.1.el9_2
  • 5.14.0-284.30.1.el9_2
  • 5.14.0-362.13.1.el9_3
  • 5.14.0-362.18.1.el9_3
  • 5.14.0-362.24.1.el9_3
  • 5.14.0-362.8.1.el9_3
  • 5.14.0-427.13.1.el9_4
  • 5.14.0-427.16.1.el9_4
  • 5.14.0-427.18.1.el9_4
  • 5.14.0-427.20.1.el9_4
  • 5.14.0-427.22.1.el9_4
  • 5.14.0-427.24.1.el9_4
  • 5.14.0-427.26.1.el9_4
  • 5.14.0-427.28.1.el9_4
  • 5.14.0-427.31.1.el9_4
  • 5.14.0-427.33.1.el9_4
  • 5.14.0-70.13.1.el9_0
  • 5.14.0-70.17.1.el9_0
  • 5.14.0-70.22.1.el9_0
  • 5.14.0-70.26.1.el9_0
  • 5.14.0-70.30.1.el9_0
  • 5.14.0-70.5.1.el9_0
Rocky Linux 9 Released
29 kernels
  • 5.14.0-70.22.1.el9_0
  • 5.14.0-70.26.1.el9_0
  • 5.14.0-70.30.1.el9_0
  • 5.14.0-162.12.1.el9_1.0.1
  • 5.14.0-162.12.1.el9_1.0.2
  • 5.14.0-162.18.1.el9_1
  • 5.14.0-162.22.2.el9_1
  • 5.14.0-162.23.1.el9_1
  • 5.14.0-162.6.1.el9_1.0.1
  • 5.14.0-162.6.1.el9_1
  • 5.14.0-284.30.1.el9_2
  • 5.14.0-362.13.1.el9_3
  • 5.14.0-362.18.1.el9_3.0.1
  • 5.14.0-362.18.1.el9_3
  • 5.14.0-362.24.1.el9_3.0.1
  • 5.14.0-362.24.1.el9_3
  • 5.14.0-362.8.1.el9_3
  • 5.14.0-427.16.1.el9_4
  • 5.14.0-427.18.1.el9_4
  • 5.14.0-427.20.1.el9_4.0.1
  • 5.14.0-427.20.1.el9_4
  • 5.14.0-427.22.1.el9_4
  • 5.14.0-427.24.1.el9_4
  • 5.14.0-427.26.1.el9_4
  • 5.14.0-427.28.1.el9_4
  • 5.14.0-427.31.1.el9_4
  • 5.14.0-427.33.1.el9_4
  • 5.14.0-284.11.1.el9_2
  • 5.14.0-427.13.1.el9_4
Ubuntu 24.04 Released
10 kernels
  • 6.8.0-35.35
  • 6.8.0-38.38
  • 6.8.0-36.36
  • 6.8.0-39.39
  • 6.8.0-40.40
  • 6.8.0-41.41
  • 6.8.0-44.44
  • 6.8.0-45.45
  • 6.8.0-31.31
  • 6.8.0-47.47