lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3410f3bc-00d9-4ab3-9ca0-5f5c988e244d@paragon-software.com>
Date: Thu, 29 Jan 2026 16:03:20 +0100
From: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To: Jiasheng Jiang <jiashengjiangcool@...il.com>,
	<linux-kernel@...r.kernel.org>
CC: <ntfs3@...ts.linux.dev>
Subject: Re: [PATCH] fs/ntfs3: Fix slab-out-of-bounds read in
 DeleteIndexEntryRoot

On 1/17/26 17:50, Jiasheng Jiang wrote:

> In the 'DeleteIndexEntryRoot' case of the 'do_action' function, the
> entry size ('esize') is retrieved from the log record without adequate
> bounds checking.
>
> Specifically, the code calculates the end of the entry ('e2') using:
>      e2 = Add2Ptr(e1, esize);
>
> It then calculates the size for memmove using 'PtrOffset(e2, ...)',
> which subtracts the end pointer from the buffer limit. If 'esize' is
> maliciously large, 'e2' exceeds the used buffer size. This results in
> a negative offset which, when cast to size_t for memmove, interprets
> as a massive unsigned integer, leading to a heap buffer overflow.
>
> This commit adds a check to ensure that the entry size ('esize') strictly
> fits within the remaining used space of the index header before performing
> memory operations.
>
> Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal")
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
> ---
>   fs/ntfs3/fslog.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
> index 38934e6978ec..28bd611f580d 100644
> --- a/fs/ntfs3/fslog.c
> +++ b/fs/ntfs3/fslog.c
> @@ -3429,6 +3429,9 @@ static int do_action(struct ntfs_log *log, struct OPEN_ATTR_ENRTY *oe,
>   
>   		e1 = Add2Ptr(attr, le16_to_cpu(lrh->attr_off));
>   		esize = le16_to_cpu(e1->size);
> +		if (PtrOffset(e1, Add2Ptr(hdr, used)) < esize)
> +			goto dirty_vol;
> +
>   		e2 = Add2Ptr(e1, esize);
>   
>   		memmove(e1, e2, PtrOffset(e2, Add2Ptr(hdr, used)));

Applied to my tree, thanks for the patch.

Regards,
Konstantin


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ