CVE-2024-41096
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
29/07/2024
Last modified:
08/09/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
PCI/MSI: Fix UAF in msi_capability_init<br />
<br />
KFENCE reports the following UAF:<br />
<br />
BUG: KFENCE: use-after-free read in __pci_enable_msi_range+0x2c0/0x488<br />
<br />
Use-after-free read at 0x0000000024629571 (in kfence-#12):<br />
__pci_enable_msi_range+0x2c0/0x488<br />
pci_alloc_irq_vectors_affinity+0xec/0x14c<br />
pci_alloc_irq_vectors+0x18/0x28<br />
<br />
kfence-#12: 0x0000000008614900-0x00000000e06c228d, size=104, cache=kmalloc-128<br />
<br />
allocated by task 81 on cpu 7 at 10.808142s:<br />
__kmem_cache_alloc_node+0x1f0/0x2bc<br />
kmalloc_trace+0x44/0x138<br />
msi_alloc_desc+0x3c/0x9c<br />
msi_domain_insert_msi_desc+0x30/0x78<br />
msi_setup_msi_desc+0x13c/0x184<br />
__pci_enable_msi_range+0x258/0x488<br />
pci_alloc_irq_vectors_affinity+0xec/0x14c<br />
pci_alloc_irq_vectors+0x18/0x28<br />
<br />
freed by task 81 on cpu 7 at 10.811436s:<br />
msi_domain_free_descs+0xd4/0x10c<br />
msi_domain_free_locked.part.0+0xc0/0x1d8<br />
msi_domain_alloc_irqs_all_locked+0xb4/0xbc<br />
pci_msi_setup_msi_irqs+0x30/0x4c<br />
__pci_enable_msi_range+0x2a8/0x488<br />
pci_alloc_irq_vectors_affinity+0xec/0x14c<br />
pci_alloc_irq_vectors+0x18/0x28<br />
<br />
Descriptor allocation done in:<br />
__pci_enable_msi_range<br />
msi_capability_init<br />
msi_setup_msi_desc<br />
msi_insert_msi_desc<br />
msi_domain_insert_msi_desc<br />
msi_alloc_desc<br />
...<br />
<br />
Freed in case of failure in __msi_domain_alloc_locked()<br />
__pci_enable_msi_range<br />
msi_capability_init<br />
pci_msi_setup_msi_irqs<br />
msi_domain_alloc_irqs_all_locked<br />
msi_domain_alloc_locked<br />
__msi_domain_alloc_locked => fails<br />
msi_domain_free_locked<br />
...<br />
<br />
That failure propagates back to pci_msi_setup_msi_irqs() in<br />
msi_capability_init() which accesses the descriptor for unmasking in the<br />
error exit path.<br />
<br />
Cure it by copying the descriptor and using the copy for the error exit path<br />
unmask operation.<br />
<br />
[ tglx: Massaged change log ]
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
CPE | From | Up to |
---|---|---|
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.17 (including) | 6.6.37 (excluding) |
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.9.8 (excluding) |
To consult the complete list of CPE names with products and versions, see this page