mirror_qemu/subprojects/libvhost-user
David Hildenbrand 52767e1063 libvhost-user: Mark mmap'ed region memory as MADV_DONTDUMP
We already use MADV_NORESERVE to deal with sparse memory regions. Let's
also set madvise(MADV_DONTDUMP), otherwise a crash of the process can
result in us allocating all memory in the mmap'ed region for dumping
purposes.

This change implies that the mmap'ed rings won't be included in a
coredump. If ever required for debugging purposes, we could mark only
the mapped rings MADV_DODUMP.

Ignore errors during madvise() for now.

Reviewed-by: Raphael Norwitz <raphael@enfabrica.net>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20240214151701.29906-15-david@redhat.com>
Tested-by: Mario Casquero <mcasquer@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2024-03-12 17:56:55 -04:00
..
include Use QEMU_SANITIZE_THREAD 2022-05-03 15:16:21 +04: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: Mark mmap'ed region memory as MADV_DONTDUMP 2024-03-12 17:56:55 -04:00
libvhost-user.h libvhost-user: Bump up VHOST_USER_MAX_RAM_SLOTS to 509 2024-03-12 17:56:55 -04:00
link-test.c
meson.build libvhost-user: Add extra compiler warnings 2023-01-11 10:44:35 +01:00