Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sysctl-based evdev property enumeration #8

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

valpackett
Copy link
Contributor

@valpackett valpackett commented Dec 30, 2018

A big security advantage of Wayland is not allowing applications to read input devices all the time. Having /dev/input/* accessible to the user account subverts this advantage.

libudev-devd was opening the evdev devices to detect their types (mouse, keyboard, touchpad, etc). This does not work when /dev/input/* is inaccessible.

With the kernel exposing this information as sysctls, we can work without /dev/input/* access, preserving the Wayland security model.

Even more: thanks to libcasper, it was pretty easy to add Capsicum support, so now my capsicumized Weston can hotplug devices! :) (UPD: left that out for now)

  • D18694 base patch that adds the sysctls

@valpackett valpackett changed the title Add support for devd-based evdev property enumeration Add support for sysctl-based evdev property enumeration Jan 2, 2019
@zeising
Copy link
Member

zeising commented Jan 2, 2019

This needs to be made (if it isn't already) so that this works on FreeBSD versions both with and without the sysctls in your base patch.

It looks like this is already done.

@zeising
Copy link
Member

zeising commented Jan 2, 2019

I have no objections, but would like to see where the FreeBSD base part of this goes first.

@zeising zeising self-assigned this Jan 2, 2019
@zeising zeising self-requested a review January 2, 2019 19:33
@zeising
Copy link
Member

zeising commented Jan 2, 2019

Hm. I probably made a mistake there, I only intended to add myself to reviewers, not remove the other ones.

@valpackett
Copy link
Contributor Author

Yeah, it is compatible with the old way, of course:

goto use_ioctl;

Just retested with an old kernel, no problems, the old one requires chmod g+rw /dev/input/* while the new one doesn't.

@zeising
Copy link
Member

zeising commented Jan 2, 2019

Yeah, it is compatible with the old way, of course:

goto use_ioctl;

Just retested with an old kernel, no problems, the old one requires chmod g+rw /dev/input/* while the new one doesn't.

Yeah, I noticed that when I took a closer look at the code.

@zeising
Copy link
Member

zeising commented Feb 25, 2019

Is this current with the changes that just went into the kernel, or does it need adjusting?

@valpackett
Copy link
Contributor Author

"input_id" was renamed to just "id". I pushed the corresponding change here. Will re-test everything later today when I get home.

@valpackett
Copy link
Contributor Author

Yep, everything works great, this is good to go.

udev-utils.c Outdated Show resolved Hide resolved
@valpackett
Copy link
Contributor Author

ping

A big security advantage of Wayland is not allowing applications to
read input devices all the time. Having /dev/input/* accessible to
the user account subverts this advantage.

libudev-devd was opening the evdev devices to detect their types (mouse,
keyboard, touchpad, etc). This does not work when /dev/input/* is
inaccessible.

With the kernel exposing this information via sysctls, we can work without
/dev/input/* access, preserving the Wayland security model.
@valpackett
Copy link
Contributor Author

rebased. wooo CI works nice

@valpackett
Copy link
Contributor Author

@zeising ping

@valpackett
Copy link
Contributor Author

@johalun @zeising ping

@johalun
Copy link
Member

johalun commented Jun 6, 2019

pong! Looks like things are in the kernel. Are we good to merge this and update the port?

@valpackett
Copy link
Contributor Author

Yeah the things have been in kernel (including -STABLE) for a while.

@zeising
Copy link
Member

zeising commented Jun 6, 2019

Sorry, I've been focusing on other things.

@zeising zeising merged commit 8efdba3 into FreeBSDDesktop:master Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants