CyberSecBulletin
CVE-2024-56640NVD status: Modified

Linux: Use After Free

CVE-2024-56640 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 f502a88fdd415647a1f2dc45fac71b9c522a052b, 0cf598548a6c36d90681d53c6b77d52363f2f295, 673d606683ac70bc074ca6676b938bff18635226 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.62% chance of exploitation within 30 days, higher than 50% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to f502a88fdd415647a1f2dc45fac71b9c522a052b or 0cf598548a6c36d90681d53c6b77d52363f2f295 or 673d606683ac70bc074ca6676b938bff18635226 or 6f0ae06a234a78ae137064f2c89135ac078a00eb, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 5.15.174 or 6.1.120 or 6.6.66 or 6.12.5, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux3b2dec2603d5b06ad3af71c1164ca0b92df3d2a8 up to, but not including, f502a88fdd415647a1f2dc45fac71b9c522a052b; 3b2dec2603d5b06ad3af71c1164ca0b92df3d2a8 up to, but not including, 0cf598548a6c36d90681d53c6b77d52363f2f295; 3b2dec2603d5b06ad3af71c1164ca0b92df3d2a8 up to, but not including, 673d606683ac70bc074ca6676b938bff18635226; 3b2dec2603d5b06ad3af71c1164ca0b92df3d2a8 up to, but not including, 6f0ae06a234a78ae137064f2c89135ac078a00eb; 3b2dec2603d5b06ad3af71c1164ca0b92df3d2a8 up to, but not including, 2c7f14ed9c19ec0f149479d1c2842ec1f9bf76d7; 4.18f502a88fdd415647a1f2dc45fac71b9c522a052b, 0cf598548a6c36d90681d53c6b77d52363f2f295, 673d606683ac70bc074ca6676b938bff18635226, 6f0ae06a234a78ae137064f2c89135ac078a00eb, 2c7f14ed9c19ec0f149479d1c2842ec1f9bf76d7
LinuxLinux Kernel4.18 up to, but not including, 5.15.174; 5.16 up to, but not including, 6.1.120; 6.2 up to, but not including, 6.6.66; 6.7 up to, but not including, 6.12.5; 6.135.15.174, 6.1.120, 6.6.66, 6.12.5

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.19.8CriticalCNA
CVSS 3.17.8HighNVD
CVSS 3.17.8HighCISA (ADP)

Official description

In the Linux kernel, the following vulnerability has been resolved: net/smc: fix LGR and link use-after-free issue We encountered a LGR/link use-after-free issue, which manifested as the LGR/link refcnt reaching 0 early and entering the clear process, making resource access unsafe. refcount_t: addition on 0; use-after-free. WARNING: CPU: 14 PID: 107447 at lib/refcount.c:25 refcount_warn_saturate+0x9c/0x140 Workqueue: events smc_lgr_terminate_work [smc] Call trace: refcount_warn_saturate+0x9c/0x140 __smc_lgr_terminate.part.45+0x2a8/0x370 [smc] smc_lgr_terminate_work+0x28/0x30 [smc] process_one_work+0x1b8/0x420 worker_thread+0x158/0x510 kthread+0x114/0x118 or refcount_t: underflow; use-after-free. WARNING: CPU: 6 PID: 93140 at lib/refcount.c:28 refcount_warn_saturate+0xf0/0x140 Workqueue: smc_hs_wq smc_listen_work [smc] Call trace: refcount_warn_saturate+0xf0/0x140 smcr_link_put+0x1cc/0x1d8 [smc] smc_conn_free+0x110/0x1b0 [smc] smc_conn_abort+0x50/0x60 [smc] smc_listen_find_device+0x75c/0x790 [smc] smc_listen_work+0x368/0x8a0 [smc] process_one_work+0x1b8/0x420 worker_thread+0x158/0x510 kthread+0x114/0x118 It is caused by repeated release of LGR/link refcnt. One suspect is that smc_conn_free() is called repeatedly because some smc_conn_free() from server listening path are not protected by sock lock. e.g. Calls under socklock | smc_listen_work ------------------------------------------------------- lock_sock(sk) | smc_conn_abort smc_conn_free | \- smc_conn_free \- smcr_link_put | \- smcr_link_put (duplicated) release_sock(sk) So here add sock lock protection in smc_listen_work() path, making it exclusive with other connection operations.

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: total).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.