]> git.ipfire.org Git - thirdparty/linux.git/commit
ntfs3: add buffer boundary checks to run_unpack()
authorTobias Gaertner <tob.gaertner@me.com>
Sun, 29 Mar 2026 11:17:02 +0000 (04:17 -0700)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 7 Apr 2026 16:43:38 +0000 (18:43 +0200)
commitb62567bca47408e6739dee75f02a2113548af875
treefb1555f3bf7e5450253ae93140c85a52f2420e73
parent6d979b64287fb051642fe0101f28c839be8ca837
ntfs3: add buffer boundary checks to run_unpack()

run_unpack() checks `run_buf < run_last` at the top of the while loop
but then reads size_size and offset_size bytes via run_unpack_s64()
without verifying they fit within the remaining buffer.  A crafted NTFS
image with truncated run data in an MFT attribute triggers an OOB heap
read of up to 15 bytes when the filesystem is mounted.

Add boundary checks before each run_unpack_s64() call to ensure the
declared field size does not exceed the remaining buffer.

Found by fuzzing with a source-patched harness (LibAFL + QEMU).

Fixes: 82cae269cfa95 ("fs/ntfs3: Add initialization of super block")
Cc: stable@vger.kernel.org
Signed-off-by: Tobias Gaertner <tob.gaertner@me.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/run.c