Skip to content

Commit 56763af

Browse files
thejhgregkh
authored andcommitted
fuse: limit FUSE_NOTIFY_RETRIEVE to uptodate folios
commit 4e3d1b2 upstream. FUSE_NOTIFY_RETRIEVE must be limited to uptodate folios; !uptodate folios can contain uninitialized data. Since FUSE_NOTIFY_RETRIEVE is intended to only return data that is already in the page cache and not wait for data from the FUSE daemon, treat !uptodate folios as if they weren't present. This only has security impact on systems that don't enable automatic zero-initialization of all page allocations via CONFIG_INIT_ON_ALLOC_DEFAULT_ON or init_on_alloc=1. Cc: stable@kernel.org Fixes: 2d45ba3 ("fuse: add retrieve request") Signed-off-by: Jann Horn <jannh@google.com> Link: https://patch.msgid.link/20260519-fuse-retrieve-uptodate-v1-1-a7a1912a37f9@google.com Acked-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 12df4cf commit 56763af

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/fuse/dev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,10 @@ static int fuse_retrieve(struct fuse_mount *fm, struct inode *inode,
19281928
folio = filemap_get_folio(mapping, index);
19291929
if (IS_ERR(folio))
19301930
break;
1931+
if (!folio_test_uptodate(folio)) {
1932+
folio_put(folio);
1933+
break;
1934+
}
19311935

19321936
folio_offset = ((index - folio->index) << PAGE_SHIFT) + offset;
19331937
nr_bytes = min(folio_size(folio) - folio_offset, num);

0 commit comments

Comments
 (0)