linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] fs: ext4: initialize fsdata in pagecache_write()
@ 2022-11-21 11:21 Alexander Potapenko
  2022-11-21 11:21 ` [PATCH 2/5] fs: affs: initialize fsdata in affs_truncate() Alexander Potapenko
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Alexander Potapenko @ 2022-11-21 11:21 UTC (permalink / raw)
  To: glider
  Cc: linux-kernel, akpm, tytso, adilger.kernel, jaegeuk, chao,
	linux-fsdevel, linux-ext4, linux-f2fs-devel, Eric Biggers,
	syzbot+9767be679ef5016b6082

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 <ebiggers@kernel.org>
Fixes: c93d8f885809 ("ext4: add basic fs-verity support")
Reported-by: syzbot+9767be679ef5016b6082@syzkaller.appspotmail.com
Signed-off-by: Alexander Potapenko <glider@google.com>
---
 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 3c640bd7ecaeb..30e3b65798b50 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 = aops->write_begin(NULL, mapping, pos, n, &page, &fsdata);
-- 
2.38.1.584.g0f3c55d4c2-goog


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-01-26 21:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 11:21 [PATCH 1/5] fs: ext4: initialize fsdata in pagecache_write() Alexander Potapenko
2022-11-21 11:21 ` [PATCH 2/5] fs: affs: initialize fsdata in affs_truncate() Alexander Potapenko
2022-11-21 19:46   ` Eric Biggers
2022-11-22  8:57     ` Alexander Potapenko
2022-11-22 14:56   ` David Sterba
2023-01-10 12:27     ` Alexander Potapenko
2023-01-10 12:47       ` David Sterba
2023-01-10 18:42       ` Eric Biggers
2022-11-21 11:21 ` [PATCH 3/5] fs: f2fs: initialize fsdata in pagecache_write() Alexander Potapenko
2022-11-21 19:53   ` Eric Biggers
2023-01-23  6:59     ` Eric Biggers
2023-01-26 21:09       ` Jaegeuk Kim
2022-11-21 11:21 ` [PATCH 4/5] fs: hfs: initialize fsdata in hfs_file_truncate() Alexander Potapenko
2023-01-24 10:51   ` Alexander Potapenko
2023-01-24 21:04     ` Andrew Morton
2023-01-25  9:51       ` Alexander Potapenko
2022-11-21 11:21 ` [PATCH 5/5] fs: hfsplus: initialize fsdata in hfsplus_file_truncate() Alexander Potapenko
2022-11-21 19:48 ` [PATCH 1/5] fs: ext4: initialize fsdata in pagecache_write() Andrew Morton
2022-11-22  3:40   ` Matthew Wilcox
2022-11-21 19:52 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).