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 9A873C64EC4 for ; Fri, 10 Mar 2023 15:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234080AbjCJPQI (ORCPT ); Fri, 10 Mar 2023 10:16:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234081AbjCJPPd (ORCPT ); Fri, 10 Mar 2023 10:15:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 050E713B2BF for ; Fri, 10 Mar 2023 07:06:44 -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 07B4B61A32 for ; Fri, 10 Mar 2023 15:05:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2063DC4339C; Fri, 10 Mar 2023 15:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678460752; bh=/Lf7aZ8QHDhnf4j+/UFvcvNCBkbmxqKB2IlHGN59YUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EfxP+xd0GpuF2uXmP9flwv9QFlGfvck9L98CBdHb1iCNMlmoL7kbAQzZ/9XFPlQX+ NtvKVLqSUbJiQH1bSAzriGvCt0v8jVKrf7EH6DpQm8kiF+zUWrhjQufH0YDif6EZn6 sK4a5i1pQ9kMUbf+nj0uFtoV/PzWlU7IAwX56ON4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Biggers , Alexander Potapenko , Eric Biggers , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.10 438/529] fs: f2fs: initialize fsdata in pagecache_write() Date: Fri, 10 Mar 2023 14:39:41 +0100 Message-Id: <20230310133825.222320785@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@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 b1b9896718bc1a212dc288ad66a5fa2fef11353d ] 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. Suggested-by: Eric Biggers Fixes: 95ae251fe828 ("f2fs: add fs-verity support") Signed-off-by: Alexander Potapenko Reviewed-by: Eric Biggers Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index dafdb19ec0dba..cef40d92268f7 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -78,7 +78,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, size_t n = min_t(size_t, count, PAGE_SIZE - offset_in_page(pos)); struct page *page; - void *fsdata; + void *fsdata = NULL; int res; res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0, -- 2.39.2