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 62CF31FB4 for ; Fri, 3 Feb 2023 10:17:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA1A5C4339B; Fri, 3 Feb 2023 10:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675419472; bh=G/su3jtvzH9r0NThXvyHeCffHzpTOyo5BMuGrBz7T14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G4MleX5pO4T+oHF5JBL5hkSuLDFeLNUn57j6NsLcQ0vMl+Odc9IQdKxFlt3/f+85b /KhUpXGN0str83oTzNUqp48cfoEwhMJ5S81VyvOg/bHCJikFirTA+hxXRu48XRbMUz DfH7MlzAR0PX5Hpe9tf+ye3xLrTxXXDQe+yGzw9w= 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 4.19 09/80] affs: initialize fsdata in affs_truncate() Date: Fri, 3 Feb 2023 11:12:03 +0100 Message-Id: <20230203101015.645939901@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101015.263854890@linuxfoundation.org> References: <20230203101015.263854890@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 ba084b0b214b..82bb38370aa9 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -878,7 +878,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