summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-keyboard.h
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2017-06-29 12:22:47 +0800
committerJonas Ådahl <jadahl@gmail.com>2018-08-17 16:34:05 +0200
commit21ce6f96f1105aa440a2a2a99ce1010fb0917dbc (patch)
tree489223ebc52b788897e81f1c8c4687447eb44271 /src/wayland/meta-wayland-keyboard.h
parent323a806d35299e22d1844b19bfcac899bd31a8cc (diff)
downloadmutter-21ce6f96f1105aa440a2a2a99ce1010fb0917dbc.tar.gz
wayland/keyboard: Create a separate keymap shm file per resource
By using the shm file when sending the keymap to all clients, we effectively allows any client to change the keymap, as any client has the ability to change the content of the file. Sending a read-only file descriptor, or making the file itself read-only before unlinking, can be worked around by the client by using chmod(2) and open(2) on /proc/<pid>/<fd>. Using memfd could potentially solve this issue, but as the usage of mmap with MAP_SHARED is wide spread among clients, such a change can not be introduced without causing wide spread compatibility issues. So, to avoid allowing clients to interfere with each other, create a separate shm file for each wl_keyboard resource when sending the keymap. We could eventually do this per client, but in most cases, there will only be one wl_keyboard resource per client anyway. https://bugzilla.gnome.org/show_bug.cgi?id=784206
Diffstat (limited to 'src/wayland/meta-wayland-keyboard.h')
-rw-r--r--src/wayland/meta-wayland-keyboard.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wayland/meta-wayland-keyboard.h b/src/wayland/meta-wayland-keyboard.h
index 88899712d..8d09a0005 100644
--- a/src/wayland/meta-wayland-keyboard.h
+++ b/src/wayland/meta-wayland-keyboard.h
@@ -74,9 +74,8 @@ typedef struct
{
struct xkb_keymap *keymap;
struct xkb_state *state;
- int keymap_fd;
size_t keymap_size;
- char *keymap_area;
+ char *keymap_string;
} MetaWaylandXkbInfo;
struct _MetaWaylandKeyboard