From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23A111A01C6; Fri, 9 Jan 2026 12:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961553; cv=none; b=Em5/1fT/alBaapKGgikJCmOpJ/vxiiAuXwtrOUujGctdSEQUjxIDwv6SAHiyCxevOlxlINwxDGzMPp+VAaFBaXcc7Giz9yFtUgE6c3HkLYBd9CPe7EjfzD35XOXQC4dSS2sAmCHW39GEiHPd/Nz+zL945KgbM7T3IE2J/XL+sCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961553; c=relaxed/simple; bh=62zaWLtNuJtR1rHLp+vJRSKDHDzREvzydj5RH8J3KGw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sV5O/D5DMen59tC14PzWWpPBdiLE6ua97Mb4k7R452D/d1Phtl4WQc9P5YOmSshkYbH+eQ8+in9ZGxSK4Tg9acwuypxLSX/9F1+zhYzW40W9Gj7Y5bHksV2p/h3ARzcPRiYW7q6TSqGOFa0HWSYr/cVRcXYFnJeX3JiYf7tfdvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1VH2e0uo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1VH2e0uo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5635AC16AAE; Fri, 9 Jan 2026 12:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767961552; bh=62zaWLtNuJtR1rHLp+vJRSKDHDzREvzydj5RH8J3KGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1VH2e0uopx55YmAoHlskUqXBxGvV2rvstGB/oEc7SEJiZumpCHrHFYTGrBKgyRkkg S10PuoCufwrDHBU2wJ2vUpqcRUJFg8u7bOMv8ONtjCgfGGadx0fuOjX6ZwOPsP8Zqg NyTcX7wXpArhyzka3J3sQ8BHWp1lmkS5GqepfR2s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+7a2ba6b7b66340cff225@syzkaller.appspotmail.com, Raphael Pinsonneault-Thibeault , Konstantin Komarov , Sasha Levin Subject: [PATCH 6.1 054/634] ntfs3: fix uninit memory after failed mi_read in mi_format_new Date: Fri, 9 Jan 2026 12:35:32 +0100 Message-ID: <20260109112119.477927115@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Raphael Pinsonneault-Thibeault [ Upstream commit 73e6b9dacf72a1e7a4265eacca46f8f33e0997d6 ] Fix a KMSAN un-init bug found by syzkaller. ntfs_get_bh() expects a buffer from sb_getblk(), that buffer may not be uptodate. We do not bring the buffer uptodate before setting it as uptodate. If the buffer were to not be uptodate, it could mean adding a buffer with un-init data to the mi record. Attempting to load that record will trigger KMSAN. Avoid this by setting the buffer as uptodate, if it’s not already, by overwriting it. Reported-by: syzbot+7a2ba6b7b66340cff225@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=7a2ba6b7b66340cff225 Tested-by: syzbot+7a2ba6b7b66340cff225@syzkaller.appspotmail.com Fixes: 4342306f0f0d5 ("fs/ntfs3: Add file operations and implementation") Signed-off-by: Raphael Pinsonneault-Thibeault Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/fsntfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index a7e2009419c37..8c165b791a1c8 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -1338,7 +1338,14 @@ int ntfs_get_bh(struct ntfs_sb_info *sbi, const struct runs_tree *run, u64 vbo, } if (buffer_locked(bh)) __wait_on_buffer(bh); - set_buffer_uptodate(bh); + + lock_buffer(bh); + if (!buffer_uptodate(bh)) + { + memset(bh->b_data, 0, blocksize); + set_buffer_uptodate(bh); + } + unlock_buffer(bh); } else { bh = ntfs_bread(sb, block); if (!bh) { -- 2.51.0