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 124A128EB for ; Mon, 30 Jan 2023 13:55:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8381FC433D2; Mon, 30 Jan 2023 13:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675086952; bh=pQuya5ZPrgAz/52e6tWxUbkyygltHis5vl6mLLqH3KY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uf/lSuoNV0QICZL0760MoILERewFS5ELgMInZG7YvRV6qeF4wLDIJKubrSiv1DdO4 2zFeH2Gnj+8YPJNAjwv+ZlEUPqyjgJGbN/LDytecCzQLprD2zVwLu9ZnygrTdEjzbS Hn5aKL6ymgCbVqRSCE76LHjPGehZ1vgbhUA6ctRE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Biggers , Alexander Potapenko , David Sterba , Sasha Levin Subject: [PATCH 6.1 051/313] affs: initialize fsdata in affs_truncate() Date: Mon, 30 Jan 2023 14:48:06 +0100 Message-Id: <20230130134339.086075132@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230130134336.532886729@linuxfoundation.org> References: <20230130134336.532886729@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Alexander Potapenko [ Upstream commit eef034ac6690118c88f357b00e2b3239c9d8575d ] When aops->write_begin() does not initialize fsdata, KMSAN may report an error passing the latter to aops->write_end(). Fix this by unconditionally initializing fsdata. Fixes: f2b6a16eb8f5 ("fs: affs convert to new aops") Suggested-by: Eric Biggers Signed-off-by: Alexander Potapenko Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/affs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/file.c b/fs/affs/file.c index cefa222f7881..8daeed31e1af 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -880,7 +880,7 @@ affs_truncate(struct inode *inode) if (inode->i_size > AFFS_I(inode)->mmu_private) { struct address_space *mapping = inode->i_mapping; struct page *page; - void *fsdata; + void *fsdata = NULL; loff_t isize = inode->i_size; int res; -- 2.39.0