CVE-2024-46738·Kernel vulnerability
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().
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.10.10
- Published
- 2024-09-18
Affected versions
From: 6.7
Until: 6.10.10
Fixed in: 6.10.10
How to fix this CVE
Update the Linux kernel to version 6.10.10 or later to patch the use-after-free vulnerability in the VMCI resource management subsystem. The fix adds type checking to resource removal operations, preventing incorrect resource deletion and subsequent memory access violations. Apply kernel updates immediately and reboot to activate the patched version.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check current kernel version with: uname -r
- Step 2: Verify VMCI module is loaded with: lsmod | grep vmci
- Step 3: Search system logs for KASAN use-after-free warnings related to vmci_resource_remove with: sudo grep -i 'vmci_resource_remove\|use-after-free' /var/log/kern.log /var/log/messages 2>/dev/null
- Step 4: After patching, confirm the new kernel version with: uname -r (should show 6.10.10 or higher)
FAQ
What is CVE-2024-46738?
CVE-2024-46738 is a use-after-free vulnerability in the Linux kernel's VMCI (Virtual Machine Communication Interface) subsystem where resources with identical handles but different types can cause incorrect resource removal, leaving freed memory pointers in the resource table.
Is CVE-2024-46738 being actively exploited?
No, CVE-2024-46738 is not currently being actively exploited in the wild according to CISA's Known Exploited Vulnerabilities catalog, and no public exploits are available.
What versions of Kernel are affected by CVE-2024-46738?
Linux kernel versions 6.7 through 6.10.10 (inclusive) are vulnerable. Systems running kernel 6.10.10 or later, or 6.11 and later, are not affected.
How do I check if my server is vulnerable to CVE-2024-46738?
Run 'uname -r' to get your kernel version. If it shows any version from 6.7 to 6.10.9, your system is vulnerable. Additionally, check if the vmci kernel module is loaded with 'lsmod | grep vmci' to determine exposure.
Does Defensia detect CVE-2024-46738?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2024-46738 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/00fe5292f081f8d773e572df8e03bf6e1855fe49
- https://git.kernel.org/stable/c/39e7e593418ccdbd151f2925fa6be1a616d16c96
- https://git.kernel.org/stable/c/48b9a8dabcc3cf5f961b2ebcd8933bf9204babb7
- https://git.kernel.org/stable/c/6c563a29857aa8053b67ee141191f69757f27f6e
- https://git.kernel.org/stable/c/b243d52b5f6f59f9d39e69b191fb3d58b94a43b1
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-46738. Free for 1 server.
Get started free