]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
virtiofs: add FUSE protocol validation
authorYuto Ohnuki <ytohnuki@amazon.com>
Mon, 16 Feb 2026 07:31:58 +0000 (07:31 +0000)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 27 Feb 2026 14:00:18 +0000 (15:00 +0100)
commit68b69fa0edb241a946cd4c850110990f30705164
tree1742d9db3e4e656d1d9bd3b02ae34438c1127740
parent42fbb31310b2c145308d3cdcb32d8f05998cfd6c
virtiofs: add FUSE protocol validation

Add virtio_fs_verify_response() to validate that the server properly
follows the FUSE protocol by checking:

- Response length is at least sizeof(struct fuse_out_header).
- oh.len matches the actual response length.
- oh.unique matches the request's unique identifier.

On validation failure, set error to -EIO and normalize oh.len to prevent
underflow in copy_args_from_argbuf().

Addresses the TODO comment in virtio_fs_request_complete().

Signed-off-by: Yuto Ohnuki <ytohnuki@amazon.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/virtio_fs.c