CyberSecBulletin
CVE-2024-26974NVD status: Modified

Linux: Time-of-check Time-of-use (TOCTOU) Race Condition

CVE-2024-26974 is a high-severity time-of-check time-of-use (TOCTOU) race condition 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 daba62d9eeddcc5b1081be7d348ca836c83c59d7, 8e81cd58aee14a470891733181a47d123193ba81, d03092550f526a79cf1ade7f0dfa74906f39eb71 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.2% 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 daba62d9eeddcc5b1081be7d348ca836c83c59d7 or 8e81cd58aee14a470891733181a47d123193ba81 or d03092550f526a79cf1ade7f0dfa74906f39eb71 or 4ae5a97781ce7d6ecc9c7055396535815b64ca4f, whichever matches your release line, or a later version.
  2. Update SIMATIC S7-1500 TM MFP - GNU/Linux subsystem to V1.1.1 or a later version.
  3. Update Linux Kernel to 4.19.312 or 5.4.274 or 5.10.215 or 5.15.154, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxd8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, daba62d9eeddcc5b1081be7d348ca836c83c59d7; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, 8e81cd58aee14a470891733181a47d123193ba81; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, d03092550f526a79cf1ade7f0dfa74906f39eb71; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, 4ae5a97781ce7d6ecc9c7055396535815b64ca4f; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, 226fc408c5fcd23cc4186f05ea3a09a7a9aef2f7; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, 8a5a7611ccc7b1fba8d933a9f22a2e76859d94dc; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, 0c2cf5142bfb634c0ef0a1a69cdf37950747d0be; d8cba25d2c68992a6e7c1d329b690a9ebe01167d up to, but not including, bb279ead42263e9fb09480f02a4247b2c287d828; and 2 more rangesdaba62d9eeddcc5b1081be7d348ca836c83c59d7, 8e81cd58aee14a470891733181a47d123193ba81, d03092550f526a79cf1ade7f0dfa74906f39eb71, 4ae5a97781ce7d6ecc9c7055396535815b64ca4f, 226fc408c5fcd23cc4186f05ea3a09a7a9aef2f7, 8a5a7611ccc7b1fba8d933a9f22a2e76859d94dc
SiemensSIMATIC S7-1500 TM MFP - GNU/Linux subsystembefore V1.1.1V1.1.1
LinuxLinux Kernel3.17 up to, but not including, 4.19.312; 4.20 up to, but not including, 5.4.274; 5.5 up to, but not including, 5.10.215; 5.11 up to, but not including, 5.15.154; 5.16 up to, but not including, 6.1.84; 6.2 up to, but not including, 6.6.24; 6.7 up to, but not including, 6.7.12; 6.8 up to, but not including, 6.8.34.19.312, 5.4.274, 5.10.215, 5.15.154, 6.1.84, 6.6.24
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 NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.0HighNVD

Official description

In the Linux kernel, the following vulnerability has been resolved: crypto: qat - resolve race condition during AER recovery During the PCI AER system's error recovery process, the kernel driver may encounter a race condition with freeing the reset_data structure's memory. If the device restart will take more than 10 seconds the function scheduling that restart will exit due to a timeout, and the reset_data structure will be freed. However, this data structure is used for completion notification after the restart is completed, which leads to a UAF bug. This results in a KFENCE bug notice. BUG: KFENCE: use-after-free read in adf_device_reset_worker+0x38/0xa0 [intel_qat] Use-after-free read at 0x00000000bc56fddf (in kfence-#142): adf_device_reset_worker+0x38/0xa0 [intel_qat] process_one_work+0x173/0x340 To resolve this race condition, the memory associated to the container of the work_struct is freed on the worker if the timeout expired, otherwise on the function that schedules the worker. The timeout detection can be done by checking if the caller is still waiting for completion or not by using completion_done() function.

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

The underlying weakness: Time-of-check Time-of-use (TOCTOU) Race Condition

The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.

How developers prevent this class of flaw

  • The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
  • When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
  • Limit the interleaving of operations on files from multiple processes.

More Time-of-check Time-of-use (TOCTOU) Race Condition vulnerabilities (CWE-367)

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 Time-of-check Time-of-use (TOCTOU) Race Condition vulnerabilities

Spotted an error? Tell us.