Jonas Ådahl 0d134522d8 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
2018-08-17 16:21:07 +02:00
2015-07-06 00:52:18 -07:00
2018-04-10 17:58:12 +02:00
2014-03-18 20:37:35 -04:00
2017-05-11 13:45:44 +02:00
2018-07-18 23:12:51 +02:00
2016-04-27 20:37:47 +02:00
2014-07-31 17:50:28 +02:00
2018-07-18 23:12:51 +02:00
Description
94 MiB
Languages
C 98.9%
Meson 0.7%
Python 0.3%