From nobody Sun Feb 8 22:22:45 2026 Received: from n169-110.mail.139.com (n169-110.mail.139.com [120.232.169.110]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B17D27B4FB; Mon, 26 Jan 2026 06:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=120.232.169.110 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769408605; cv=none; b=lMQozIT++X/uEq0soenssiCWaBtcip+CuJW+FMpSHwo2sV3zWj8AVf16b0thwvrsrIHOfZjMcYipwked15/IDFm/HTUvN1sjdRZR3iuNOp2b5DgvOHnM6QVrH23R8ulrqzn6vSW0s9J9EKaxrp1m+JM6jN2usZ73BKtxHLRXBuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769408605; c=relaxed/simple; bh=5kCPEOD+PaXCGQXRgOfei3ya8nySHRJvqN6Bxpv9oGk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IqHFFiHma9A0Bhq/AcOVnBd7VBKq3aPmI5d/5ExDW03GO2AJMWOxc13mow2aV0J6BrIpyF6kUiYZLH+QtyBlvP+RgJCwxE2Xj0AK0d8YR5ZSvVltyGDUSiLSUK6GoPozKUbKiOSGRsIiB+wZYp4uR84nGu8S3ShwD5SF7QbQIO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=139.com; spf=pass smtp.mailfrom=139.com; dkim=pass (1024-bit key) header.d=139.com header.i=@139.com header.b=FAEACfoy; arc=none smtp.client-ip=120.232.169.110 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=139.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=139.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=139.com header.i=@139.com header.b="FAEACfoy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=139.com; s=dkim; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=FAEACfoyRQtmS3aS26u6Ji4HWugyF8SxCkeiU40AmXTiqy27Ui2pSXgmfLC0L9cnwnf3ggohDjV1f LeRQbkYAN4CMIkWR2lxcpki0h3DYz8zKkucwxpAQ2y5L0d5JmzGp/FF3UWJHtGShfC92JOTUSFnP79 OhlDN1iXG5rS48qw= X-RM-TagInfo: emlType=0 X-RM-SPAM: X-RM-SPAM-FLAG: 00000000 Received: from NTT-kernel-dev (unknown[60.247.85.88]) by rmsmtp-lg-appmail-02-12080 (RichMail) with SMTP id 2f3069770793b93-00ba2; Mon, 26 Jan 2026 14:20:10 +0800 (CST) X-RM-TRANSID: 2f3069770793b93-00ba2 From: Li hongliang <1468888505@139.com> To: gregkh@linuxfoundation.org, stable@vger.kernel.org, kubik.bartlomiej@gmail.com Cc: patches@lists.linux.dev, linux-kernel@vger.kernel.org, almaz.alexandrovich@paragon-software.com, ntfs3@lists.linux.dev, khalid@kernel.org Subject: [PATCH 5.15.y] fs/ntfs3: Initialize allocated memory before use Date: Mon, 26 Jan 2026 14:19:56 +0800 Message-Id: <20260126061956.1206899-1-1468888505@139.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bartlomiej Kubik [ Upstream commit a8a3ca23bbd9d849308a7921a049330dc6c91398 ] KMSAN reports: Multiple uninitialized values detected: - KMSAN: uninit-value in ntfs_read_hdr (3) - KMSAN: uninit-value in bcmp (3) Memory is allocated by __getname(), which is a wrapper for kmem_cache_alloc(). This memory is used before being properly cleared. Change kmem_cache_alloc() to kmem_cache_zalloc() to properly allocate and clear memory before use. Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Fixes: 78ab59fee07f ("fs/ntfs3: Rework file operations") Tested-by: syzbot+332bd4e9d148f11a87dc@syzkaller.appspotmail.com Reported-by: syzbot+332bd4e9d148f11a87dc@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D332bd4e9d148f11a87dc Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Fixes: 78ab59fee07f ("fs/ntfs3: Rework file operations") Tested-by: syzbot+0399100e525dd9696764@syzkaller.appspotmail.com Reported-by: syzbot+0399100e525dd9696764@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D0399100e525dd9696764 Reviewed-by: Khalid Aziz Signed-off-by: Bartlomiej Kubik Signed-off-by: Konstantin Komarov Signed-off-by: Li hongliang <1468888505@139.com> --- fs/ntfs3/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 7ac76e6c35dc..acd5be0d36c0 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -1298,7 +1298,7 @@ struct inode *ntfs_create_inode(struct user_namespace= *mnt_userns, fa |=3D FILE_ATTRIBUTE_READONLY; =20 /* Allocate PATH_MAX bytes. */ - new_de =3D __getname(); + new_de =3D kmem_cache_zalloc(names_cachep, GFP_KERNEL); if (!new_de) { err =3D -ENOMEM; goto out1; @@ -1694,10 +1694,9 @@ int ntfs_link_inode(struct inode *inode, struct dent= ry *dentry) struct ATTR_FILE_NAME *de_name; =20 /* Allocate PATH_MAX bytes. */ - de =3D __getname(); + de =3D kmem_cache_zalloc(names_cachep, GFP_KERNEL); if (!de) return -ENOMEM; - memset(de, 0, PATH_MAX); =20 /* Mark rw ntfs as dirty. It will be cleared at umount. */ ntfs_set_state(sbi, NTFS_DIRTY_DIRTY); @@ -1742,7 +1741,7 @@ int ntfs_unlink_inode(struct inode *dir, const struct= dentry *dentry) return -EINVAL; =20 /* Allocate PATH_MAX bytes. */ - de =3D __getname(); + de =3D kmem_cache_zalloc(names_cachep, GFP_KERNEL); if (!de) return -ENOMEM; =20 --=20 2.34.1