vfio-user: vfio_user_get_region_info: respect max_xfer_size
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Fixes: 667866d66620 ("vfio-user: implement VFIO_USER_DEVICE_GET_REGION_INFO") Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260721122643.30985-3-thanos.makatos@nutanix.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
Thanos Makatos committed
Jul 21, 2026 at 12:26 UTC
152f7dd3b04f1ad8e99248610c74f876e0da2107
1 file changed
+4
hw/vfio-user/device.c
+4
@@ -137,6 +137,10 @@ static int vfio_user_get_region_info(VFIOUserProxy *proxy,
137
error_printf("vfio_user_get_region_info argsz too large\n");
138
return -E2BIG;
139
}
140
+ if (size > proxy->max_xfer_size) {
141
+ error_printf("vfio_user_get_region_info argsz too large\n");
142
+ return -E2BIG;
143
+ }
144
145
if (fds != NULL && fds->send_fds != 0) {
146
error_printf("vfio_user_get_region_info can't send FDs\n");