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 0379D882B for ; Fri, 10 Mar 2023 15:11:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E700C4339B; Fri, 10 Mar 2023 15:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678461115; bh=1eW3HevDhVQxFrd1e1mmvEENxSnM2ZNW7GYNSezBk54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=goPKjtMytNNJH2fysnDawyWxrQz9/9kf/iQBUPY4yJc0V3aUffoAge0Oy7Zy4jas/ fccHDBfAvj8gC7iNCGtvn1PU2S1LTVmvh8tT/RChettJHgXuSl9ekRVpm9X2HhicoZ dmRzPAaWOoSVOpLaCGAgsMJ7G+oAvnfz8HGfb3oY= 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.15 009/136] fs: f2fs: initialize fsdata in pagecache_write() Date: Fri, 10 Mar 2023 14:42:11 +0100 Message-Id: <20230310133707.186034533@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133706.811226272@linuxfoundation.org> References: <20230310133706.811226272@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 [ 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 26e7154168291..d5a50e73ec32b 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