qemu/subprojects/libvhost-user
Raphael Norwitz b906a23c33 libvhost-user: prevent over-running max RAM slots
When VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS support was added to
libvhost-user, no guardrails were added to protect against QEMU
attempting to hot-add too many RAM slots to a VM with a libvhost-user
based backed attached.

This change adds the missing error handling by introducing a check on
the number of RAM slots the device has available before proceeding to
process the VHOST_USER_ADD_MEM_REG message.

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20220117041050.19718-6-raphael.norwitz@nutanix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2022-02-04 09:07:43 -05:00
..
include meson: fix meson 0.58 warning with libvhost-user subproject 2021-07-29 10:15:52 +02:00
standard-headers meson: fix meson 0.58 warning with libvhost-user subproject 2021-07-29 10:15:52 +02:00
libvhost-user-glib.c
libvhost-user-glib.h
libvhost-user.c libvhost-user: prevent over-running max RAM slots 2022-02-04 09:07:43 -05:00
libvhost-user.h libvhost-user: Add vu_rem_mem_reg input validation 2022-02-04 09:07:43 -05:00
link-test.c
meson.build meson: fix meson 0.58 warning with libvhost-user subproject 2021-07-29 10:15:52 +02:00