Commit 905c0a34 authored by Derek Foreman's avatar Derek Foreman

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

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's avatarDerek Foreman <>
Reviewed-by: Simon Ser's avatarSimon Ser <>
Reviewed-by: Daniel Stone's avatarDaniel Stone <>
Reviewed-by: default avatarPhilipp Kerling <>
Acked-by: Pekka Paalanen's avatarPekka Paalanen <>
parent 01095a9c
......@@ -1660,7 +1660,7 @@
<interface name="wl_seat" version="6">
<interface name="wl_seat" version="7">
<description summary="group of input devices">
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 @@
<interface name="wl_pointer" version="6">
<interface name="wl_pointer" version="7">
<description summary="pointer input device">
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 @@
<interface name="wl_keyboard" version="6">
<interface name="wl_keyboard" version="7">
<description summary="keyboard input device">
The wl_keyboard interface represents one or more keyboards
associated with a seat.
......@@ -2113,6 +2113,9 @@
<description summary="keyboard mapping">
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.
<arg name="format" type="uint" enum="keymap_format" summary="keymap format"/>
<arg name="fd" type="fd" summary="keymap file descriptor"/>
......@@ -2203,7 +2206,7 @@
<interface name="wl_touch" version="6">
<interface name="wl_touch" version="7">
<description summary="touchscreen input device">
The wl_touch interface represents a touchscreen
associated with a seat.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment