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 19E6FC677F1 for ; Mon, 16 Jan 2023 16:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233438AbjAPQp6 (ORCPT ); Mon, 16 Jan 2023 11:45:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233708AbjAPQpb (ORCPT ); Mon, 16 Jan 2023 11:45:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773413018F for ; Mon, 16 Jan 2023 08:33:00 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2515CB81071 for ; Mon, 16 Jan 2023 16:32:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74F7BC433EF; Mon, 16 Jan 2023 16:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673886777; bh=L8iSiOOe3xAf1h/v0+0aD/8dcs0sLHw2BN+quSTVRG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZbNHtlFcWEtqPAfppMoevyhXLgcFsGCbAD9e5mxORVsXtgyPx4NOUk8jBpYqAXARk x9D7PH1CoC2rKko9JpsVNdWAuANe3aE5BoVsJS3Txmdpo9HnhdeKlUvQP/CstBci8v T4vwurYsDzsgcM3qGSm1yyDVog4i+IxMBV7N3Q4g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Biggers , syzbot+9767be679ef5016b6082@syzkaller.appspotmail.com, Alexander Potapenko , Eric Biggers , Theodore Tso , stable@kernel.org, Sasha Levin Subject: [PATCH 5.4 559/658] fs: ext4: initialize fsdata in pagecache_write() Date: Mon, 16 Jan 2023 16:50:47 +0100 Message-Id: <20230116154935.070899927@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154909.645460653@linuxfoundation.org> References: <20230116154909.645460653@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 956510c0c7439e90b8103aaeaf4da92878c622f0 ] When aops->write_begin() does not initialize fsdata, KMSAN reports an error passing the latter to aops->write_end(). Fix this by unconditionally initializing fsdata. Cc: Eric Biggers Fixes: c93d8f885809 ("ext4: add basic fs-verity support") Reported-by: syzbot+9767be679ef5016b6082@syzkaller.appspotmail.com Signed-off-by: Alexander Potapenko Reviewed-by: Eric Biggers Link: https://lore.kernel.org/r/20221121112134.407362-1-glider@google.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Sasha Levin --- fs/ext4/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c index 0c67b7060eb4..9879ea046e5a 100644 --- a/fs/ext4/verity.c +++ b/fs/ext4/verity.c @@ -79,7 +79,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.35.1