From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 813086FBB for ; Tue, 10 Jan 2023 18:28:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08341C433D2; Tue, 10 Jan 2023 18:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673375292; bh=F8MtU1eoxuh5zPfD3IUNPi7HDU9HplHkb6kAhC7HvjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1TVTWEAAHcDbgbbDOrQQ8azzzOUtDSyuoG41wsiozalm0b3D5K418V6YE6sdRQxz JZ3JlHTC5Q4dWIW93Ee58PaamwS3LJf2jX09lUpa0EgLuwTXK5DjOwwHE1xbiYVYB2 Se6tf+tVJeffnMjLdUeCkqkS2/P4uUgNWYu+HN9Q= 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 5.15 142/290] fs: ext4: initialize fsdata in pagecache_write() Date: Tue, 10 Jan 2023 19:03:54 +0100 Message-Id: <20230110180036.748145939@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110180031.620810905@linuxfoundation.org> References: <20230110180031.620810905@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 @@ -76,7 +76,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 = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0,