Bug 2334500 (CVE-2024-56619) - CVE-2024-56619 kernel: nilfs2: fix potential out-of-bounds memory access in nilfs_find_entry()
Summary: CVE-2024-56619 kernel: nilfs2: fix potential out-of-bounds memory access in n...
Keywords:
Status: NEW
Alias: CVE-2024-56619
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-12-27 15:06 UTC by OSIDB Bzimport
Modified: 2025-01-20 15:43 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-12-27 15:06:06 UTC
In the Linux kernel, the following vulnerability has been resolved:

nilfs2: fix potential out-of-bounds memory access in nilfs_find_entry()

Syzbot reported that when searching for records in a directory where the
inode's i_size is corrupted and has a large value, memory access outside
the folio/page range may occur, or a use-after-free bug may be detected if
KASAN is enabled.

This is because nilfs_last_byte(), which is called by nilfs_find_entry()
and others to calculate the number of valid bytes of directory data in a
page from i_size and the page index, loses the upper 32 bits of the 64-bit
size information due to an inappropriate type of local variable to which
the i_size value is assigned.

This caused a large byte offset value due to underflow in the end address
calculation in the calling nilfs_find_entry(), resulting in memory access
that exceeds the folio/page size.

Fix this issue by changing the type of the local variable causing the bit
loss from "unsigned int" to "u64".  The return value of nilfs_last_byte()
is also of type "unsigned int", but it is truncated so as not to exceed
PAGE_SIZE and no bit loss occurs, so no change is required.

Comment 1 Avinash Hanwate 2024-12-28 05:14:51 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024122709-CVE-2024-56619-501d@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.