CyberSecBulletin
CVE-2023-53577NVD status: Modified

Linux: Missing Release of Memory after Effective Lifetime

CVE-2023-53577 is a high-severity missing release of memory after effective lifetime 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 b44d28b98f185d2f2348aa3c3636838c316f889e, 7a1178a3671b40746830d355836b72e47ceb2490, ecb45b852af5e88257020b88bea5ff0798d72aca 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.16% 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 b44d28b98f185d2f2348aa3c3636838c316f889e or 7a1178a3671b40746830d355836b72e47ceb2490 or ecb45b852af5e88257020b88bea5ff0798d72aca or 640a604585aa30f93e39b17d4d6ba69fcb1e66c9, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 5.15.126 or 6.1.45 or 6.4.10, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux6710e1126934d8b4372b4d2f9ae1646cd3f151bf up to, but not including, b44d28b98f185d2f2348aa3c3636838c316f889e; 6710e1126934d8b4372b4d2f9ae1646cd3f151bf up to, but not including, 7a1178a3671b40746830d355836b72e47ceb2490; 6710e1126934d8b4372b4d2f9ae1646cd3f151bf up to, but not including, ecb45b852af5e88257020b88bea5ff0798d72aca; 6710e1126934d8b4372b4d2f9ae1646cd3f151bf up to, but not including, 640a604585aa30f93e39b17d4d6ba69fcb1e66c9; 4.15b44d28b98f185d2f2348aa3c3636838c316f889e, 7a1178a3671b40746830d355836b72e47ceb2490, ecb45b852af5e88257020b88bea5ff0798d72aca, 640a604585aa30f93e39b17d4d6ba69fcb1e66c9
LinuxLinux Kernel4.15 up to, but not including, 5.15.126; 5.16 up to, but not including, 6.1.45; 6.2 up to, but not including, 6.4.10; 6.55.15.126, 6.1.45, 6.4.10

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: bpf, cpumap: Make sure kthread is running before map update returns The following warning was reported when running stress-mode enabled xdp_redirect_cpu with some RT threads: ------------[ cut here ]------------ WARNING: CPU: 4 PID: 65 at kernel/bpf/cpumap.c:135 CPU: 4 PID: 65 Comm: kworker/4:1 Not tainted 6.5.0-rc2+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Workqueue: events cpu_map_kthread_stop RIP: 0010:put_cpu_map_entry+0xda/0x220 ...... Call Trace: <TASK> ? show_regs+0x65/0x70 ? __warn+0xa5/0x240 ...... ? put_cpu_map_entry+0xda/0x220 cpu_map_kthread_stop+0x41/0x60 process_one_work+0x6b0/0xb80 worker_thread+0x96/0x720 kthread+0x1a5/0x1f0 ret_from_fork+0x3a/0x70 ret_from_fork_asm+0x1b/0x30 </TASK> The root cause is the same as commit 436901649731 ("bpf: cpumap: Fix memory leak in cpu_map_update_elem"). The kthread is stopped prematurely by kthread_stop() in cpu_map_kthread_stop(), and kthread() doesn't call cpu_map_kthread_run() at all but XDP program has already queued some frames or skbs into ptr_ring. So when __cpu_map_ring_cleanup() checks the ptr_ring, it will find it was not emptied and report a warning. An alternative fix is to use __cpu_map_ring_cleanup() to drop these pending frames or skbs when kthread_stop() returns -EINTR, but it may confuse the user, because these frames or skbs have been handled correctly by XDP program. So instead of dropping these frames or skbs, just make sure the per-cpu kthread is running before __cpu_map_entry_alloc() returns. After apply the fix, the error handle for kthread_stop() will be unnecessary because it will always return 0, so just remove it.

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

The underlying weakness: Missing Release of Memory after Effective Lifetime

The product does not sufficiently track and release allocated memory after it has been used, making the memory unavailable for reallocation and reuse.

How developers prevent this class of flaw

  • Choose a language or tool that provides automatic memory management, or makes manual memory management less error-prone. For example, glibc in Linux provides protection against free of invalid pointers. When using Xcode to target OS X or iOS, enable automatic reference counting (ARC). To help correctly and consistently manage memory when programming in C++, consider using a smart pointer class such as std
  • Use an abstraction library to abstract away risky APIs. Not a complete solution.
  • Consider using the Boehm-Demers-Weiser garbage collector (bdwgc), which can help avoid leaks.

More Missing Release of Memory after Effective Lifetime vulnerabilities (CWE-401)

Timeline

  1. CVE record published.
  2. Record last changed materially (score, affected products, status or references).

References

Recent Missing Release of Memory after Effective Lifetime vulnerabilities

Spotted an error? Tell us.