public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+2472d48b2d3b2a23a570@syzkaller.appspotmail.com>
To: tristmd@gmail.com
Cc: tristmd@gmail.com, linux-kernel@vger.kernel.org,
	 syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] KMSAN: uninit-value in indx_insert_into_buffer
Date: Fri, 17 Apr 2026 09:21:48 -0700	[thread overview]
Message-ID: <69e25e1c.050a0220.1de265.002e.GAE@google.com> (raw)
In-Reply-To: <177644290581.3791540.2286061222451144900@talencesecurity.com>

> #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

This crash does not have a reproducer. I cannot test it.

>>From 6a686b1fe4f68f59165fc7d2d02b621331c47ca4 Mon Sep 17 00:00:00 2001
> From: Tristan Madani <tristan@talencesecurity.com>
> Date: Fri, 17 Apr 2026 16:15:17 +0000
> Subject: [PATCH] ntfs3: zero-initialize trailing VBN slot in index entry
>  allocations
> indx_insert_into_buffer() and indx_delete_entry() allocate index
> entries with an extra sizeof(u64) for the VBN slot using kmalloc.
> The VBN slot is not explicitly initialized, leaving stale heap data
> that KMSAN detects as uninit-value.
> Replace kmalloc with kzalloc at both allocation sites to ensure
> the trailing VBN slot is zero-initialized.
> Reported-by: syzbot+2472d48b2d3b2a23a570@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=2472d48b2d3b2a23a570
> Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
> ---
>  fs/ntfs3/index.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
> index 97f06c2..a1d8c05 100644
> --- a/fs/ntfs3/index.c
> +++ b/fs/ntfs3/index.c
> @@ -1838,7 +1838,7 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
>  		return -EINVAL;
>  
>  	sp_size = le16_to_cpu(sp->size);
> -	up_e = kmalloc(sp_size + sizeof(u64), GFP_NOFS);
> +	up_e = kzalloc(sp_size + sizeof(u64), GFP_NOFS);
>  	if (!up_e)
>  		return -ENOMEM;
>  	memcpy(up_e, sp, sp_size);
> @@ -2226,7 +2226,7 @@ static int indx_get_entry_to_replace(struct ntfs_index *indx,
>  		goto out;
>  	}
>  	/* Copy the candidate entry into the replacement entry buffer. */
> -	re = kmalloc(le16_to_cpu(te->size) + sizeof(u64), GFP_NOFS);
> +	re = kzalloc(le16_to_cpu(te->size) + sizeof(u64), GFP_NOFS);
>  	if (!re) {
>  		err = -ENOMEM;
>  		goto out;
> -- 
> 2.47.3

           reply	other threads:[~2026-04-17 16:21 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <177644290581.3791540.2286061222451144900@talencesecurity.com>]

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=69e25e1c.050a0220.1de265.002e.GAE@google.com \
    --to=syzbot+2472d48b2d3b2a23a570@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tristmd@gmail.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