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 76199C61DA4 for ; Mon, 30 Jan 2023 14:11:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237183AbjA3OK7 (ORCPT ); Mon, 30 Jan 2023 09:10:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237210AbjA3OKv (ORCPT ); Mon, 30 Jan 2023 09:10:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD293BD87 for ; Mon, 30 Jan 2023 06:10:40 -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 EBDF061086 for ; Mon, 30 Jan 2023 14:10:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F26C433EF; Mon, 30 Jan 2023 14:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675087839; bh=8N3Y5qSC60YSLIWZ5FXaT0Pk2QNwmnPgXL+K2TsiDMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fekfX/2UChZdbVu9WTNEd6OFsCXqQcAQxy4dbTFDvpYs8/KByiKH+IWcTKcgxqFkZ BDiU4AEG8vEFiEUV9VzZQFNyElOJwNUYirjB85/BtKRg52/AK+aSK9iNl7fKG+0hcy bDA0oVtJfXQyCCuzWzOkhRUh5GKqgUVCzpl41hOc= 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.15 026/204] affs: initialize fsdata in affs_truncate() Date: Mon, 30 Jan 2023 14:49:51 +0100 Message-Id: <20230130134317.454176147@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230130134316.327556078@linuxfoundation.org> References: <20230130134316.327556078@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 75ebd2b576ca..25d480ea797b 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -881,7 +881,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