xwayland: Use MAP_PRIVATE for keymaps

With wl_pointer.axis_v120 support, the wl_seat supported version has
been bumped to 8, but Xwayland is still using MAP_SHARED which is
prohibited, wl_seat version 7 and above enforces the use of MAP_PRIVATE
for keymaps.

Use MAP_PRIVATE for the keymaps mmap().

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1512
Fixes: 3a02f56b4 - hook up wl_pointer.axis_v120 events
This commit is contained in:
Olivier Fourdan 2023-03-02 10:12:25 +01:00 committed by Olivier Fourdan
parent c6f2598a4e
commit d5dd3f3cee

View File

@ -1110,7 +1110,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
munmap(xwl_seat->keymap, xwl_seat->keymap_size);
xwl_seat->keymap_size = size;
xwl_seat->keymap = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
xwl_seat->keymap = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
if (xwl_seat->keymap == MAP_FAILED) {
xwl_seat->keymap_size = 0;
xwl_seat->keymap = NULL;