linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: lei lu <llfamsec@gmail.com>
To: almaz.alexandrovich@paragon-software.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	ntfs3@lists.linux.dev
Subject: Re: [PATCH 3/6] fs/ntfs3: Sequential field availability check in mi_enum_attr()
Date: Thu, 10 Oct 2024 19:00:05 +0800	[thread overview]
Message-ID: <20241010110005.42792-1-llfamsec@gmail.com> (raw)
In-Reply-To: <20241001090104.15313-4-almaz.alexandrovich@paragon-software.com>

Hi, Konstantin,

Refer to: https://lore.kernel.org/ntfs3/20240820105342.79788-1-llfamsec@gmail.com/T/#t.

In https://github.com/Paragon-Software-Group/linux-ntfs3/blob/master/fs/ntfs3/record.c#L267.
The code did not check the 'non_res' field. If asize is just 8 bytes, it still trigger OOB.
So I added "if (asize < SIZEOF_RESIDENT)" before accessing the 'non_res'. Because
SIZEOF_RESIDENT is smaller than SIZEOF_NONRESIDENT which seems to be the minimum size of
attr. Or maybe we can use "if (off + 9 > used)" directly.

Thanks,
LL

  reply	other threads:[~2024-10-10 11:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01  9:00 [PATCH 0/6] Syzbot bugfixes and refactoring Konstantin Komarov
2024-10-01  9:00 ` [PATCH 1/6] fs/ntfs3: Fix possible deadlock in mi_read Konstantin Komarov
2024-10-01  9:01 ` [PATCH 2/6] fs/ntfs3: Additional check in ni_clear() Konstantin Komarov
2024-10-01  9:01 ` [PATCH 3/6] fs/ntfs3: Sequential field availability check in mi_enum_attr() Konstantin Komarov
2024-10-10 11:00   ` lei lu [this message]
2024-10-01  9:01 ` [PATCH 4/6] fs/ntfs3: Fix general protection fault in run_is_mapped_full Konstantin Komarov
2024-10-01  9:01 ` [PATCH 5/6] fs/ntfs3: Additional check in ntfs_file_release Konstantin Komarov
2024-10-01  9:01 ` [PATCH 6/6] fs/ntfs3: Format output messages like others fs in kernel Konstantin Komarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241010110005.42792-1-llfamsec@gmail.com \
    --to=llfamsec@gmail.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).