Cyber Posture

CVE-2024-57892

High

Published: 15 January 2025

Published
15 January 2025
Modified
03 November 2025
KEV Added
Patch
CVSS Score 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0002 5.2th percentile
Risk Priority 16 60% EPSS · 20% KEV · 20% CVSS

Description

In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv When mounting ocfs2 and then remounting it as read-only, a slab-use-after-free occurs after the user uses a syscall to quota_getnextquota. Specifically, sb_dqinfo(sb, type)->dqi_priv is the dangling pointer. During the remounting process, the pointer dqi_priv is freed but is never set as null leaving it to be accessed. Additionally, the read-only option for remounting sets the DQUOT_SUSPENDED flag instead of setting the DQUOT_USAGE_ENABLED flags. Moreover, later in the process of getting the next quota, the function ocfs2_get_next_id is called and only checks the quota usage flags and not the quota suspended flags. To fix this, I set dqi_priv to null when it is freed after remounting with read-only and put a check for DQUOT_SUSPENDED in ocfs2_get_next_id. [akpm@linux-foundation.org: coding-style cleanups]

Security Summary

CVE-2024-57892 is a slab-use-after-free vulnerability in the Linux kernel's ocfs2 filesystem, caused by a dangling pointer in sb_dqinfo(sb, type)->dqi_priv. The issue arises when an ocfs2 filesystem is mounted, remounted as read-only, and then a user calls the quota_getnextquota syscall. During remounting, dqi_priv is freed but not set to NULL, allowing subsequent access. Additionally, read-only remount sets the DQUOT_SUSPENDED flag rather than DQUOT_USAGE_ENABLED, and the ocfs2_get_next_id function checks only usage flags, ignoring the suspended state.

A local attacker with low privileges (PR:L) can exploit this vulnerability with low complexity (AC:L) and no user interaction (UI:N), as indicated by its CVSS v3.1 score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). By mounting an ocfs2 filesystem, remounting it read-only, and invoking quota_getnextquota, the attacker triggers the use-after-free, potentially leading to high confidentiality, integrity, and availability impacts, such as arbitrary code execution or system crashes via the dangling pointer dereference.

Mitigation is provided through upstream kernel patches, available in multiple stable releases via the referenced commits. These fixes explicitly set dqi_priv to NULL after freeing it during read-only remount and add a DQUOT_SUSPENDED flag check in ocfs2_get_next_id to prevent invalid access. Security practitioners should update affected Linux kernels to incorporate these patches.

Details

CWE(s)
CWE-416

Affected Products

linux
linux kernel
6.13 · 4.6 — 6.1.125 · 6.2 — 6.6.70 · 6.7 — 6.12.9

References