CyberSecBulletin
CVE-2024-46738NVD status: Modified

Linux: Use After Free

CVE-2024-46738 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions f6365931bf7c07b2b397dbb06a4f6573cc9fae73, b243d52b5f6f59f9d39e69b191fb3d58b94a43b1, 6c563a29857aa8053b67ee141191f69757f27f6e as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.28% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to f6365931bf7c07b2b397dbb06a4f6573cc9fae73 or b243d52b5f6f59f9d39e69b191fb3d58b94a43b1 or 6c563a29857aa8053b67ee141191f69757f27f6e or ef5f4d0c5ee22d4f873116fec844ff6edaf3fa7d, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.322 or 5.4.284 or 5.10.226 or 5.15.167, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxbc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, f6365931bf7c07b2b397dbb06a4f6573cc9fae73; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, b243d52b5f6f59f9d39e69b191fb3d58b94a43b1; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, 6c563a29857aa8053b67ee141191f69757f27f6e; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, ef5f4d0c5ee22d4f873116fec844ff6edaf3fa7d; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, b9efdf333174468651be40390cbc79c9f55d9cce; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, 39e7e593418ccdbd151f2925fa6be1a616d16c96; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, 00fe5292f081f8d773e572df8e03bf6e1855fe49; bc63dedb7d46a7d690c6b6edf69136b88af06cc6 up to, but not including, 48b9a8dabcc3cf5f961b2ebcd8933bf9204babb7; and 1 more rangesf6365931bf7c07b2b397dbb06a4f6573cc9fae73, b243d52b5f6f59f9d39e69b191fb3d58b94a43b1, 6c563a29857aa8053b67ee141191f69757f27f6e, ef5f4d0c5ee22d4f873116fec844ff6edaf3fa7d, b9efdf333174468651be40390cbc79c9f55d9cce, 39e7e593418ccdbd151f2925fa6be1a616d16c96
LinuxLinux Kernel3.9 up to, but not including, 4.19.322; 4.20 up to, but not including, 5.4.284; 5.5 up to, but not including, 5.10.226; 5.11 up to, but not including, 5.15.167; 5.16 up to, but not including, 6.1.110; 6.2 up to, but not including, 6.6.51; 6.7 up to, but not including, 6.10.10; 6.114.19.322, 5.4.284, 5.10.226, 5.15.167, 6.1.110, 6.6.51

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

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().

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.