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 2D614C678DA for ; Wed, 4 Jan 2023 16:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239894AbjADQ0M (ORCPT ); Wed, 4 Jan 2023 11:26:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240031AbjADQZW (ORCPT ); Wed, 4 Jan 2023 11:25:22 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF01433D52 for ; Wed, 4 Jan 2023 08:25:21 -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 A4F60B81733 for ; Wed, 4 Jan 2023 16:25:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8596C433D2; Wed, 4 Jan 2023 16:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672849519; bh=ksgXcK1NaxphJYJtafeiAOuNITTClBgyX0yxEtDAZWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BG5oJGLFDE8y3a7JHYtJbZVhBsxTSf3tJNI8UwbmFXqR/Zew/HPVR2FtRRctvlQOM XQUR9Cos3v4fXbhypQ412c1HFIUzNB76w5d+GCSnE9UUBZiwz+BQvH2FBhqprYBjkv 6CuhFvQWsWGR8JXHF+H0C5eCPY4e4XLmYDx+Cv4w= 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 Subject: [PATCH 6.0 135/177] fs: ext4: initialize fsdata in pagecache_write() Date: Wed, 4 Jan 2023 17:07:06 +0100 Message-Id: <20230104160511.739737676@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230104160507.635888536@linuxfoundation.org> References: <20230104160507.635888536@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 commit 956510c0c7439e90b8103aaeaf4da92878c622f0 upstream. 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: Greg Kroah-Hartman --- fs/ext4/verity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/verity.c +++ b/fs/ext4/verity.c @@ -79,7 +79,7 @@ static int pagecache_write(struct inode 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 = aops->write_begin(NULL, mapping, pos, n, &page, &fsdata);