CyberSecBulletin
CVE-2024-26960NVD status: Modified

Linux: Concurrent Execution using Shared Resource with Improper Synchronization

CVE-2024-26960 is a high-severity concurrent execution using shared resource with improper synchronization vulnerability in Linux, with a CVSS 3.1 base score of 7.0 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 d85c11c97ecf92d47a4b29e3faca714dc1f18d0d, 2da5568ee222ce0541bfe446a07998f92ed1643e, 1ede7f1d7eed1738d1b9333fd1e152ccb450b86a 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.18% 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 d85c11c97ecf92d47a4b29e3faca714dc1f18d0d or 2da5568ee222ce0541bfe446a07998f92ed1643e or 1ede7f1d7eed1738d1b9333fd1e152ccb450b86a or 0f98f6d2fb5fad00f8299b84b85b6bc1b6d7d19a, whichever matches your release line, or a later version.
  2. Update linux_kernel to d85c11c97ecf or 2da5568ee222 or 1ede7f1d7eed or 0f98f6d2fb5f, whichever matches your release line, or a later version.
  3. Update SIMATIC S7-1500 TM MFP - GNU/Linux subsystem to V1.1.1 or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, d85c11c97ecf92d47a4b29e3faca714dc1f18d0d; 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, 2da5568ee222ce0541bfe446a07998f92ed1643e; 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, 1ede7f1d7eed1738d1b9333fd1e152ccb450b86a; 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, 0f98f6d2fb5fad00f8299b84b85b6bc1b6d7d19a; 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, 3ce4c4c653e4e478ecb15d3c88e690f12cbf6b39; 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, 363d17e7f7907c8e27a9e86968af0eaa2301787b; 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e up to, but not including, 82b1c07a0af603e3c47b906c8e991dc96f01688e; 4.11d85c11c97ecf92d47a4b29e3faca714dc1f18d0d, 2da5568ee222ce0541bfe446a07998f92ed1643e, 1ede7f1d7eed1738d1b9333fd1e152ccb450b86a, 0f98f6d2fb5fad00f8299b84b85b6bc1b6d7d19a, 3ce4c4c653e4e478ecb15d3c88e690f12cbf6b39, 363d17e7f7907c8e27a9e86968af0eaa2301787b
Linuxlinux_kernel7c00bafee87c up to, but not including, d85c11c97ecf; 7c00bafee87c up to, but not including, 2da5568ee222; 7c00bafee87c up to, but not including, 1ede7f1d7eed; 7c00bafee87c up to, but not including, 0f98f6d2fb5f; 7c00bafee87c up to, but not including, 3ce4c4c653e4; 7c00bafee87c up to, but not including, 363d17e7f790; 7c00bafee87c up to, but not including, 82b1c07a0af6; 4.11d85c11c97ecf, 2da5568ee222, 1ede7f1d7eed, 0f98f6d2fb5f, 3ce4c4c653e4, 363d17e7f790
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystembefore V1.1.1V1.1.1
DebianDebian Linux10.0Not stated

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
HighSuccess depends on conditions outside the attacker's control.
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:H/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by CNA.

Scoring systemScoreSeverityScored by
CVSS 3.17.0HighCNA
CVSS 3.15.5MediumCISA (ADP)

Official description

In the Linux kernel, the following vulnerability has been resolved: mm: swap: fix race between free_swap_and_cache() and swapoff() There was previously a theoretical window where swapoff() could run and teardown a swap_info_struct while a call to free_swap_and_cache() was running in another thread. This could cause, amongst other bad possibilities, swap_page_trans_huge_swapped() (called by free_swap_and_cache()) to access the freed memory for swap_map. This is a theoretical problem and I haven't been able to provoke it from a test case. But there has been agreement based on code review that this is possible (see link below). Fix it by using get_swap_device()/put_swap_device(), which will stall swapoff(). There was an extra check in _swap_info_get() to confirm that the swap entry was not free. This isn't present in get_swap_device() because it doesn't make sense in general due to the race between getting the reference and swapoff. So I've added an equivalent check directly in free_swap_and_cache(). Details of how to provoke one possible issue (thanks to David Hildenbrand for deriving this): --8<----- __swap_entry_free() might be the last user and result in "count == SWAP_HAS_CACHE". swapoff->try_to_unuse() will stop as soon as soon as si->inuse_pages==0. So the question is: could someone reclaim the folio and turn si->inuse_pages==0, before we completed swap_page_trans_huge_swapped(). Imagine the following: 2 MiB folio in the swapcache. Only 2 subpages are still references by swap entries. Process 1 still references subpage 0 via swap entry. Process 2 still references subpage 1 via swap entry. Process 1 quits. Calls free_swap_and_cache(). -> count == SWAP_HAS_CACHE [then, preempted in the hypervisor etc.] Process 2 quits. Calls free_swap_and_cache(). -> count == SWAP_HAS_CACHE Process 2 goes ahead, passes swap_page_trans_huge_swapped(), and calls __try_to_reclaim_swap(). __try_to_reclaim_swap()->folio_free_swap()->delete_from_swap_cache()-> put_swap_folio()->free_swap_slot()->swapcache_free_entries()-> swap_entry_free()->swap_range_free()-> ... WRITE_ONCE(si->inuse_pages, si->inuse_pages - nr_entries); What stops swapoff to succeed after process 2 reclaimed the swap cache but before process1 finished its call to swap_page_trans_huge_swapped()? --8<-----

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

The underlying weakness: Concurrent Execution using Shared Resource with Improper Synchronization

The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.

How developers prevent this class of flaw

  • In languages that support it, use synchronization primitives. Only wrap these around critical code to minimize the impact on performance.
  • Use thread-safe capabilities such as the data access abstraction in Spring.
  • Minimize the usage of shared resources in order to remove as much complexity as possible from the control flow and to reduce the likelihood of unexpected conditions occurring. Additionally, this will minimize the amount of synchronization necessary and may even help to reduce the likelihood of a denial of service where an attacker may be able to repeatedly trigger a critical section (CWE-400).

More Concurrent Execution using Shared Resource with Improper Synchronization vulnerabilities (CWE-362)

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

Third-party and government advisories

Recent Concurrent Execution using Shared Resource with Improper Synchronization vulnerabilities

Spotted an error? Tell us.