mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
ui/win32: fix potential use-after-free with dbus shared memory
DisplaySurface may be free before the pixman image is freed, since the image is refcounted and used by different objects, including pending dbus messages. Furthermore, setting the destroy function in create_displaysurface_from() isn't appropriate, as it may not be used, and may be overriden as in ramfb. Set the destroy function when the shared handle is set, use the HANDLE directly for destroy data, using a single common helper qemu_pixman_win32_image_destroy(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-5-marcandre.lureau@redhat.com>
This commit is contained in:
parent
244d52ff73
commit
330ef31deb
4 changed files with 21 additions and 34 deletions
|
@ -97,6 +97,8 @@ void qemu_pixman_glyph_render(pixman_image_t *glyph,
|
|||
|
||||
void qemu_pixman_image_unref(pixman_image_t *image);
|
||||
|
||||
void qemu_pixman_win32_image_destroy(pixman_image_t *image, void *data);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(pixman_image_t, qemu_pixman_image_unref)
|
||||
|
||||
#endif /* QEMU_PIXMAN_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue