From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40ECFC61DA4 for ; Fri, 3 Feb 2023 10:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233502AbjBCKZg (ORCPT ); Fri, 3 Feb 2023 05:25:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233544AbjBCKZ2 (ORCPT ); Fri, 3 Feb 2023 05:25:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64DB49D587 for ; Fri, 3 Feb 2023 02:25:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBE7D61E5D for ; Fri, 3 Feb 2023 10:25:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B68C5C433EF; Fri, 3 Feb 2023 10:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675419908; bh=G/su3jtvzH9r0NThXvyHeCffHzpTOyo5BMuGrBz7T14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N18GOy4tnoXBDEWyy/jHWuxWaIzDOiEZT+93EdihTbANRlQ81TWAeMzYPynmsEngH rCBcXB8F4B+WKb0m6kCfNx3wQ3F8xXiJ5GMReNF+zR1QFiSDizS4RcTbB9rbI1kvHw zqhfDs5XMPPyGEn0Ty7dXIg4dJxnSnoSm6W8m34U= 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 5.4 017/134] affs: initialize fsdata in affs_truncate() Date: Fri, 3 Feb 2023 11:12:02 +0100 Message-Id: <20230203101024.632714775@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101023.832083974@linuxfoundation.org> References: <20230203101023.832083974@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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