CVE-2024-53130 nilfs2: fix null-ptr-deref in block_dirty_buffer tracepoint

Medium 5.5 Published Updated

A local attacker can trigger a kernel crash in the nilfs2 filesystem by exploiting a null pointer dereference in the block_dirty_buffer tracepoint.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-53130?

CVE-2024-53130 is a medium-severity vulnerability in Linux kernel, published on 4 Dec 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

nilfs2: fix null-ptr-deref in block_dirty_buffer tracepoint

When using the "block:block_dirty_buffer" tracepoint, mark_buffer_dirty() may cause a NULL pointer dereference, or a general protection fault when KASAN is enabled.

This happens because, since the tracepoint was added in mark_buffer_dirty(), it references the dev_t member bh->b_bdev->bd_dev regardless of whether the buffer head has a pointer to a block_device structure.

In the current implementation, nilfs_grab_buffer(), which grabs a buffer to read (or create) a block of metadata, including b-tree node blocks, does not set the block device, but instead does so only if the buffer is not in the "uptodate" state for each of its caller block reading functions. However, if the uptodate flag is set on a folio/page, and the buffer heads are detached from it by try_to_free_buffers(), and new buffer heads are then attached by create_empty_buffers(), the uptodate flag may be restored to each buffer without the block device being set to bh->b_bdev, and mark_buffer_dirty() may be called later in that state, resulting in the bug mentioned above.

Fix this issue by making nilfs_grab_buffer() always set the block device of the super block structure to the buffer head, regardless of the state of the buffer's uptodate flag.

Weakness: CWE-476

Which versions are affected by CVE-2024-53130?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-53130?

Apply the vendor's patch.

Is CVE-2024-53130 being exploited?

There is no known exploitation of CVE-2024-53130 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as AZL-54158, AZL-54168, BELL-CVE-2024-53130, DEBIAN-CVE-2024-53130, GHSA-c52g-v6h9-jghm, UBUNTU-CVE-2024-53130.

Is CVE-2024-53130 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free