From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Lizhi Xu <lizhi.xu@windriver.com>,
<syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com>
Cc: <linux-kernel@vger.kernel.org>, <ntfs3@lists.linux.dev>,
<syzkaller-bugs@googlegroups.com>
Subject: Re: [PATCH] ntfs3: avoid memcpy size warning
Date: Thu, 20 Nov 2025 10:04:35 +0100 [thread overview]
Message-ID: <f8929047-fd9c-4a34-8c12-2ac93f85c75d@paragon-software.com> (raw)
In-Reply-To: <20251009023733.3705264-1-lizhi.xu@windriver.com>
On 10/9/25 04:37, Lizhi Xu wrote:
> There are more entries after the structure, use unsafe_memcpy() to avoid
> this warning.
>
> syzbot reported:
> memcpy: detected field-spanning write (size 3656) of single field "hdr1" at fs/ntfs3/index.c:1927 (size 16)
> Call Trace:
> indx_insert_entry+0x1a0/0x460 fs/ntfs3/index.c:1996
> ni_add_name+0x4dd/0x820 fs/ntfs3/frecord.c:2995
> ni_rename+0x98/0x170 fs/ntfs3/frecord.c:3026
> ntfs_rename+0xab9/0xf00 fs/ntfs3/namei.c:332
>
> Reported-by: syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=3a1878433bc1cb97b42a
> Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
> ---
> fs/ntfs3/index.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
> index 6d1bf890929d..7157cfd70fdc 100644
> --- a/fs/ntfs3/index.c
> +++ b/fs/ntfs3/index.c
> @@ -1924,7 +1924,8 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
> * Undo critical operations.
> */
> indx_mark_free(indx, ni, new_vbn >> indx->idx2vbn_bits);
> - memcpy(hdr1, hdr1_saved, used1);
> + unsafe_memcpy(hdr1, hdr1_saved, used1,
> + "There are entries after the structure");
> indx_write(indx, ni, n1, 0);
> }
>
Thanks for the patch. Applied.
Regards,
Konstantin
prev parent reply other threads:[~2025-11-20 9:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-05 23:30 [syzbot] [ntfs3?] WARNING in indx_insert_into_buffer (3) syzbot
2025-10-06 10:47 ` syzbot
2025-10-07 21:52 ` Forwarded: syzbot
2025-10-09 2:37 ` [PATCH] ntfs3: avoid memcpy size warning Lizhi Xu
2025-11-20 9:04 ` 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=f8929047-fd9c-4a34-8c12-2ac93f85c75d@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.xu@windriver.com \
--cc=ntfs3@lists.linux.dev \
--cc=syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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®