CTSRD-CHERI / cheribsd-ports

FreeBSD ports tree adapted for CheriBSD.
https://CheriBSD.org
Other
5 stars 11 forks source link

x11-wm/plasma5-kwin: Fix trusting processes on linprocfs-less FreeBSD #63

Closed jrtc27 closed 1 year ago

jrtc27 commented 1 year ago

Some of KWin's Wayland interfaces require the binary to be trusted, but the code to do this relies on a Linux-like procfs to be mounted. FreeBSD has linprocfs, so a workaround would be to mount that on FreeBSD, but it's currently tied to Linuxulator bits and doesn't get built on CHERI architectures in CheriBSD. Instead, change the code to use FreeBSD's sysctl equivalent with a slightly ugly patch.

This fixes Task Manager not knowing about any of the open windows, since the org_kde_plasma_window_management_interface interface it uses for that is one of the restricted interfaces, and so it would sit there forever waiting for its plasmaWindowManagementAnnounced callback to be invoked.

Note that in 5.26 KWaylandServer is merged into KWin itself and so we should instead reuse a generalised (to configure whether it does a readlink before returning) executablePathFromPid, since that already has a FreeBSD variant, and is where this code was copied from. Such a change should also be upstreamed.