From 905c0a341ddf0a885811d19e2b79c65a3f1d210c Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 1 Nov 2018 11:15:46 -0500 Subject: [PATCH] protocol: Bump seat to version 7 and require keymaps be private Weston commit 76829fc4eaea329d2a525c3978271e13bd76c078 (and similar commits for other compositors) protects the compositor's keyboard mapping from client damage by duplicating the keymap for every client. On some systems there are other potential fixes for this - such as using sealed memfds on linux - but we can't use them since essentially all client code anywhere has mapped the keyboard map with a MAP_SHARED mmap() call. While we can't break years worth of code, we can require any future clients to use MAP_PRIVATE if they use a seat version above 6. If a compositor can't use sealing or a similar facility, it should still protect itself with copied keymaps, but clients must always assume shared mapping of a keymap will fail. Signed-off-by: Derek Foreman Reviewed-by: Simon Ser Reviewed-by: Daniel Stone Reviewed-by: Philipp Kerling Acked-by: Pekka Paalanen --- protocol/wayland.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 141038b..802d433 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -1660,7 +1660,7 @@ - + A seat is a group of keyboards, pointer and touch devices. This object is published as a global during start up, or when such a @@ -1769,7 +1769,7 @@ - + The wl_pointer interface represents one or more input devices, such as mice, which control the pointer location and pointer_focus @@ -2092,7 +2092,7 @@ - + The wl_keyboard interface represents one or more keyboards associated with a seat. @@ -2113,6 +2113,9 @@ This event provides a file descriptor to the client which can be memory-mapped to provide a keyboard mapping description. + + From version 7 onwards, the fd must be mapped with MAP_PRIVATE by + the recipient, as MAP_SHARED may fail. @@ -2203,7 +2206,7 @@ - + The wl_touch interface represents a touchscreen associated with a seat. -- 2.7.4