linux-next/fs/fuse
Bernd Schubert 78f2560fc9 fuse: Set *nbytesp=0 in fuse_get_user_pages on allocation failure
In fuse_get_user_pages(), set *nbytesp to 0 when struct page **pages
allocation fails. This prevents the caller (fuse_direct_io) from making
incorrect assumptions that could lead to NULL pointer dereferences
when processing the request reply.

Previously, *nbytesp was left unmodified on allocation failure, which
could cause issues if the caller assumed pages had been added to
ap->descs[] when they hadn't.

Reported-by: syzbot+87b8e6ed25dbc41759f7@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=87b8e6ed25dbc41759f7
Fixes: 3b97c3652d ("fuse: convert direct io to use folios")
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Tested-by: Dmitry Antipov <dmantipov@yandex.ru>
Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2024-12-13 16:43:36 +01:00
..
acl.c fuse: support idmapped ->set_acl 2024-09-04 16:51:11 +02:00
control.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
cuse.c fuse: remove pages for requests and exclusively use folios 2024-11-05 14:08:35 +01:00
dax.c virtiofs: dax: remove ->writepages() callback 2024-11-18 12:24:38 +01:00
dev.c fuse update for 6.13 2024-11-26 12:41:27 -08:00
dir.c fuse: check attributes staleness on fuse_iget() 2024-11-18 12:24:13 +01:00
file.c fuse: Set *nbytesp=0 in fuse_get_user_pages on allocation failure 2024-12-13 16:43:36 +01:00
fuse_i.h fuse: check attributes staleness on fuse_iget() 2024-11-18 12:24:13 +01:00
fuse_trace.h fuse: add simple request tracepoints 2024-08-29 11:43:13 +02:00
inode.c fuse: check attributes staleness on fuse_iget() 2024-11-18 12:24:13 +01:00
ioctl.c fuse: remove pages for requests and exclusively use folios 2024-11-05 14:08:35 +01:00
iomode.c fuse: fix parallel dio write on file open in passthrough mode 2024-04-15 10:12:44 +02:00
Kconfig fuse: introduce FUSE_PASSTHROUGH capability 2024-02-23 17:36:32 +01:00
Makefile fuse: enable dynamic configuration of fuse max pages limit (FUSE_MAX_MAX_PAGES) 2024-10-25 17:05:49 +02:00
passthrough.c backing-file: clean up the API 2024-11-11 10:45:03 +01:00
readdir.c fuse: check attributes staleness on fuse_iget() 2024-11-18 12:24:13 +01:00
sysctl.c fuse: enable dynamic configuration of fuse max pages limit (FUSE_MAX_MAX_PAGES) 2024-10-25 17:05:49 +02:00
virtio_fs.c virtio: features, fixes, cleanups 2024-11-27 13:11:58 -08:00
xattr.c fs/fuse: introduce and use fuse_simple_idmap_request() helper 2024-09-23 11:07:55 +02:00