Summary: | wl_keyboard::keymap fd is shared and can be modified from any client | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | d138e196 |
Component: | input | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | bcooksley, daniel, kde |
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | All | ||
Latest Commit: | https://commits.kde.org/kwayland/6bfa71d89aeec9bda402639118f09706d9985037 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
Minimal example that makes the keymap invalid
Minimal example that makes the keymap invalid |
Comment 2
David Edmundson
2020-03-17 17:26:59 UTC
Git commit 6bfa71d89aeec9bda402639118f09706d9985037 by Vlad Zahorodnii. Committed on 19/03/2020 at 14:04. Pushed by vladz into branch 'master'. Pass a dedicated fd to each keyboard for the xkb keymap Summary: To better isolate the clients from each other eachh KeyboardInterface creates it's own dedicated temporary file and sends the fd for this temporary file to the client. This means the memory for the keymap is no longer shared between all clients, every client has an own copy. To support this the existing API to set the keymap is deprecated and replaced by a new method setKeymapData which takes the content of the keymap as a byte array. The now deprecated method which takes a file descriptor is changed to use the new setKeymapData method. For that it reads the content of the file. The implementation in KeyboardInterface to create the file descriptor is based on the implementation of KWin. As I implemented the change in KWin (see 3b4c508ee36ac74c37e77fcaa14d106397ad2994) it is not a problem from GPL vs LGPL perspective. The change includes test cases to verify that the content of the keymap is properly passed to the client and that the memory is no longer shared. Reviewers: #kwin, #frameworks, davidedmundson, zzag Reviewed By: #kwin, zzag Subscribers: plasma-devel, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D14910 M +94 -2 autotests/client/test_wayland_seat.cpp M +1 -1 src/server/CMakeLists.txt M +26 -0 src/server/keyboard_interface.cpp M +1 -0 src/server/keyboard_interface.h M +3 -0 src/server/keyboard_interface_p.h M +26 -8 src/server/seat_interface.cpp M +22 -2 src/server/seat_interface.h M +1 -2 src/server/seat_interface_p.h https://commits.kde.org/kwayland/6bfa71d89aeec9bda402639118f09706d9985037 |