Skip to main content

CVE-2024-56565: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-56565cvecve-2024-56565
Published: Fri Dec 27 2024 (12/27/2024, 14:23:09 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to drop all discards after creating snapshot on lvm device Piergiorgio reported a bug in bugzilla as below: ------------[ cut here ]------------ WARNING: CPU: 2 PID: 969 at fs/f2fs/segment.c:1330 RIP: 0010:__submit_discard_cmd+0x27d/0x400 [f2fs] Call Trace: __issue_discard_cmd+0x1ca/0x350 [f2fs] issue_discard_thread+0x191/0x480 [f2fs] kthread+0xcf/0x100 ret_from_fork+0x31/0x50 ret_from_fork_asm+0x1a/0x30 w/ below testcase, it can reproduce this bug quickly: - pvcreate /dev/vdb - vgcreate myvg1 /dev/vdb - lvcreate -L 1024m -n mylv1 myvg1 - mount /dev/myvg1/mylv1 /mnt/f2fs - dd if=/dev/zero of=/mnt/f2fs/file bs=1M count=20 - sync - rm /mnt/f2fs/file - sync - lvcreate -L 1024m -s -n mylv1-snapshot /dev/myvg1/mylv1 - umount /mnt/f2fs The root cause is: it will update discard_max_bytes of mounted lvm device to zero after creating snapshot on this lvm device, then, __submit_discard_cmd() will pass parameter @nr_sects w/ zero value to __blkdev_issue_discard(), it returns a NULL bio pointer, result in panic. This patch changes as below for fixing: 1. Let's drop all remained discards in f2fs_unfreeze() if snapshot of lvm device is created. 2. Checking discard_max_bytes before submitting discard during __submit_discard_cmd().

AI-Powered Analysis

AILast updated: 06/28/2025, 11:54:49 UTC

Technical Analysis

CVE-2024-56565 is a vulnerability identified in the Linux kernel's f2fs (Flash-Friendly File System) module, specifically related to the handling of discard commands on Logical Volume Manager (LVM) devices when snapshots are created. The vulnerability arises from improper management of discard operations after an LVM snapshot is created on a mounted f2fs filesystem. The root cause is that the kernel updates the discard_max_bytes parameter of the mounted LVM device to zero after snapshot creation. Subsequently, the function __submit_discard_cmd() passes a zero value for the number of sectors (@nr_sects) to __blkdev_issue_discard(), which returns a NULL bio pointer. This leads to a kernel panic, causing a denial of service (DoS) condition. The issue can be reproduced by creating an LVM volume, formatting it with f2fs, performing file operations, creating a snapshot of the logical volume, and then unmounting the filesystem. The patch to fix this vulnerability involves two key changes: first, dropping all remaining discard requests in the f2fs_unfreeze() function if an LVM snapshot has been created; second, adding a check for discard_max_bytes before submitting discard commands in __submit_discard_cmd(). This prevents the submission of invalid discard requests that would cause the kernel panic. The vulnerability affects Linux kernel versions containing the specified commit hashes and is relevant to systems using f2fs on LVM devices with snapshot functionality. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running Linux with f2fs filesystems on LVM devices where snapshots are used. The impact is a potential denial of service due to kernel panic, which can cause system crashes and service interruptions. This can affect critical infrastructure, cloud service providers, and enterprises relying on Linux servers for storage and virtualization. The disruption could lead to downtime, data unavailability, and operational delays. Although the vulnerability does not directly lead to privilege escalation or data corruption, the DoS condition can be exploited by attackers with local access or by malicious insiders to disrupt services. Organizations with automated snapshot and backup processes using LVM on f2fs are particularly at risk. The lack of known exploits suggests limited immediate threat, but the vulnerability should be addressed promptly to prevent future exploitation. The impact on confidentiality and integrity is low, but availability impact is medium to high depending on the criticality of affected systems.

Mitigation Recommendations

European organizations should take the following specific mitigation steps: 1) Apply the official Linux kernel patch that addresses this vulnerability as soon as it becomes available from trusted sources or Linux distribution vendors. 2) Review and audit systems using f2fs on LVM devices with snapshot capabilities to identify vulnerable kernel versions. 3) Temporarily avoid creating snapshots on LVM devices formatted with f2fs until patched, especially in production environments. 4) Implement monitoring for kernel panics and system crashes related to discard operations to detect potential exploitation attempts. 5) Harden access controls to limit local user access to systems where this vulnerability exists, reducing the risk of exploitation. 6) Test backup and snapshot workflows in controlled environments after patching to ensure stability. 7) Engage with Linux distribution security advisories and subscribe to vulnerability notifications to stay informed about updates. These measures go beyond generic advice by focusing on the specific interaction between f2fs, LVM snapshots, and discard commands.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-27T14:03:05.995Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9823c4522896dcbdf261

Added to database: 5/21/2025, 9:08:51 AM

Last enriched: 6/28/2025, 11:54:49 AM

Last updated: 8/15/2025, 10:42:40 PM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats