Vulnerability · Published Sep 18, 2024 · Assigned by Linux

CVE-2024-46738VMCI: Fix use-after-free when removing resource in vmci_resource_remove()

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 20% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.3%top 79.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: VMCI: Fix use-after-free when removing resource in vmci_resource_remove() When removing a resource from vmci_resource_table in vmci_resource_remove(), the search is performed using the resource handle by comparing context and resource fields. It is possible though to create two resources with different types but same handle (same context and resource fields). When trying to remove one of the resources, vmci_resource_remove() may not remove the intended one, but the object will still be freed as in the case of the datagram type in vmci_datagram_destroy_handle(). vmci_resource_table will still hold a pointer to this freed resource leading to a use-after-free vulnerability. BUG: KASAN: use-after-free in vmci_handle_is_equal include/linux/vmw_vmci_defs.h:142 [inline] BUG: KASAN: use-after-free in vmci_resource_remove+0x3a1/0x410 drivers/misc/vmw_vmci/vmci_resource.c:147 Read of size 4 at addr ffff88801c16d800 by task syz-executor197/1592 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x82/0xa9 lib/dump_stack.c:106 print_address_description.constprop.0+0x21/0x366 mm/kasan/report.c:239 __kasan_report.cold+0x7f/0x132 mm/kasan/report.c:425 kasan_report+0x38/0x51 mm/kasan/report.c:442 vmci_handle_is_equal include/linux/vmw_vmci_defs.h:142 [inline] vmci_resource_remove+0x3a1/0x410 drivers/misc/vmw_vmci/vmci_resource.c:147 vmci_qp_broker_detach+0x89a/0x11b9 drivers/misc/vmw_vmci/vmci_queue_pair.c:2182 ctx_free_ctx+0x473/0xbe1 drivers/misc/vmw_vmci/vmci_context.c:444 kref_put include/linux/kref.h:65 [inline] vmci_ctx_put drivers/misc/vmw_vmci/vmci_context.c:497 [inline] vmci_ctx_destroy+0x170/0x1d6 drivers/misc/vmw_vmci/vmci_context.c:195 vmci_host_close+0x125/0x1ac drivers/misc/vmw_vmci/vmci_host.c:143 __fput+0x261/0xa34 fs/file_table.c:282 task_work_run+0xf0/0x194 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x184/0x189 kernel/entry/common.c:187 exit_to_user_mode_prepare+0x11b/0x123 kernel/entry/common.c:220 __syscall_exit_to_user_mode_work kernel/entry/common.c:302 [inline] syscall_exit_to_user_mode+0x18/0x42 kernel/entry/common.c:313 do_syscall_64+0x41/0x85 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x6e/0x0 This change ensures the type is also checked when removing the resource from vmci_resource_table in vmci_resource_remove().

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.112-1DEBIAN-CVE-2024-46738
Debian:13linux6.10.11-1DEBIAN-CVE-2024-46738
Debian:14linux6.10.11-1DEBIAN-CVE-2024-46738
Ubuntu:22.04:LTSlinux5.15.0-125.135UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux6.8.0-50.51UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-aws5.15.0-1072.78UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-aws6.8.0-1020.22UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1020.22~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure5.15.0-1075.84UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-azure6.8.0-1020.23UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1020.23~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1076.85.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gcp5.15.0-1071.79UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-gcp6.8.0-1019.21UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1019.21~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gke5.15.0-1069.75UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-gke6.8.0-1015.19UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1055.62UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1002.4UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-50.51~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-ibm5.15.0-1065.68UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-ibm6.8.0-1017.17UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1017.17~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1067.73UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-kvm5.15.0-1069.74UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-125.135UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-50.51.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-50.51.1~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1067.68UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1019.21UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1019.21~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1019.21.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1032.32UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1020.20UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1018.18UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oracle5.15.0-1070.76UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-oracle6.8.0-1017.18UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1017.18~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-raspi5.15.0-1065.68UBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-raspi6.8.0-1016.18UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-riscv6.8.0-50.51.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-50.51.1~22.04.1UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-46738
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2024-46738
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1038.42UBUNTU-CVE-2024-46738

Affected products (as reported)

VendorProductVersions
Linux Linux bc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before f6365931bf7c07b2b397dbb06a4f6573cc9fae73bc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before b243d52b5f6f59f9d39e69b191fb3d58b94a43b1bc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before 6c563a29857aa8053b67ee141191f69757f27f6ebc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before ef5f4d0c5ee22d4f873116fec844ff6edaf3fa7dbc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before b9efdf333174468651be40390cbc79c9f55d9ccebc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before 39e7e593418ccdbd151f2925fa6be1a616d16c96bc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before 00fe5292f081f8d773e572df8e03bf6e1855fe49bc63dedb7d46a7d690c6b6edf69136b88af06cc6 – before 48b9a8dabcc3cf5f961b2ebcd8933bf9204babb7
Linux Linux 3.9

References