From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Hongling Zeng <zenghongling@kylinos.cn>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<zhongling0719@126.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH] ntfs3: fix mapping pairs bounds check for alignment
Date: Wed, 28 Oct 2026 08:39:36 +0100 [thread overview]
Message-ID: <a486f930-0107-4e28-a077-f70b734568ae@paragon-software.com> (raw)
In-Reply-To: <20260805064559.53060-1-zenghongling@kylinos.cn>
On 8/5/26 08:45, Hongling Zeng wrote:
> In the UpdateMappingPairs action, the expansion check compares the
> unaligned new attribute size with the available record space. The new
> size is aligned to an 8-byte boundary before the mapping pairs are
> updated, so the check can underestimate the required space by up to
> seven bytes.
>
> Use the aligned size in the expansion check to ensure that the
> subsequent update cannot exceed the available record space.
>
> Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> ---
> fs/ntfs3/fslog.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
> index cc24c23e4db9..3440212ecb12 100644
> --- a/fs/ntfs3/fslog.c
> +++ b/fs/ntfs3/fslog.c
> @@ -3388,7 +3388,8 @@ static int do_action(struct ntfs_log *log, struct OPEN_ATTR_ENRTY *oe,
>
> if (!check_if_attr(rec, lrh) || !attr->non_res ||
> aoff < le16_to_cpu(attr->nres.run_off) || aoff > asize ||
> - (nsize > asize && nsize - asize > record_size - used)) {
> + (nsize > asize &&
> + ALIGN(nsize, 8) - asize > record_size - used)) {
> goto dirty_vol;
> }
>
Hello,
Your patch is applied, thanks.
Regards,
Konstantin
prev parent reply other threads:[~2026-10-28 7:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 6:45 Hongling Zeng
2026-10-28 7:39 ` Konstantin Komarov [this message]
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=a486f930-0107-4e28-a077-f70b734568ae@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=zenghongling@kylinos.cn \
--cc=zhongling0719@126.com \
/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
all inboxes | Powered by JetHome®