public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Bartlomiej Kubik <kubik.bartlomiej@gmail.com>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<david.hunter.linux@gmail.com>, <skhan@linuxfoundation.org>,
	<khalid@kernel.org>, <linux-kernel-mentees@lists.linux.dev>,
	<syzbot+08d8956768c96a2c52cf@syzkaller.appspotmail.com>
Subject: Re: [PATCH] fs/ntfs3: Initialize new folios before use
Date: Tue, 9 Dec 2025 14:37:05 +0100	[thread overview]
Message-ID: <7b477b93-a521-4f87-9bee-e17505e46690@paragon-software.com> (raw)
In-Reply-To: <20251126220251.856795-1-kubik.bartlomiej@gmail.com>

On 11/26/25 23:02, Bartlomiej Kubik wrote:

> KMSAN reports an uninitialized value in longest_match_std(), invoked
> from ntfs_compress_write(). When new folios are allocated without being
> marked uptodate and ni_read_frame() is skipped because the caller expects
> the frame to be completely overwritten, some reserved folios may remain
> only partially filled, leaving the rest memory uninitialized.
>
> Fixes: 584f60ba22f7 ("ntfs3: Convert ntfs_get_frame_pages() to use a folio")
> Tested-by: syzbot+08d8956768c96a2c52cf@syzkaller.appspotmail.com
> Reported-by: syzbot+08d8956768c96a2c52cf@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=08d8956768c96a2c52cf
>
> Signed-off-by: Bartlomiej Kubik <kubik.bartlomiej@gmail.com>
> ---
>   fs/ntfs3/file.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
> index 4c90ec2fa2ea..00df27876c50 100644
> --- a/fs/ntfs3/file.c
> +++ b/fs/ntfs3/file.c
> @@ -930,7 +930,7 @@ static int ntfs_get_frame_pages(struct address_space *mapping, pgoff_t index,
>
>   		folio = __filemap_get_folio(mapping, index,
>   					    FGP_LOCK | FGP_ACCESSED | FGP_CREAT,
> -					    gfp_mask);
> +					    gfp_mask | __GFP_ZERO);
>   		if (IS_ERR(folio)) {
>   			while (npages--) {
>   				folio = page_folio(pages[npages]);
> --
> 2.39.5
>
Queued for the next merge window, thanks.

Regards,
Konstantin


      reply	other threads:[~2025-12-09 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 22:02 [PATCH] fs/ntfs3: Initialize new folios before use Bartlomiej Kubik
2025-12-09 13:37 ` 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=7b477b93-a521-4f87-9bee-e17505e46690@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=david.hunter.linux@gmail.com \
    --cc=khalid@kernel.org \
    --cc=kubik.bartlomiej@gmail.com \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=skhan@linuxfoundation.org \
    --cc=syzbot+08d8956768c96a2c52cf@syzkaller.appspotmail.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