-
Notifications
You must be signed in to change notification settings - Fork 457
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
client: remove /dev/input/ based idle detection #2463
client: remove /dev/input/ based idle detection #2463
Conversation
The code tries to open /dev/input/mice as if it was a directory. If there are no input devices, like in a headless machine, the code repeatedly tries to make a list of input devices. On Debian, these bugs, together with Debian's patches to BOINC, result in useless error messages in client's log. On SELinux systems, services can access device nodes in /dev/input/ only if given that right in SELinux configuration. On some Fedora versions BOINC client doesn't have that right and the code results in numerous SELinux warnings. These warnings in turn result in high CPU usage when the system analyzes the warnings. Furthermore, the code doesn't work at all. The code expects that input drivers update timestamps on device nodes when the drivers receive input from devices. The input drivers however have no such code. Checking driver commit logs suggest that if such code ever existed it was so long time ago that we don't need to care about it and testing distros of various ages confirms that. Since the code doesn't and can't work solve the problems on Debian and Fedora by just removing the code altogether. The code was only used on Linux and /dev/input/ seems to be Linux only thing anyway. Note that the client has similar code for checking terminal devices. Contrary to the input device code that code does work correctly. This is because programs running on a terminal have their inputs and outputs connected to the terminal device node. Input to or output from a program results in a read from or write to device node and terminal drivers do have code that updates timestamps on reads and writes. Closes #2335. See #1187.
Fedora has allowed BOINC client to access input devices for some time. boinc.te You might want to have that access right removed from the policy at same point, after this change is in a released BOINC version and once you are sure that no-one running an older BOINC version is going to receive a policy update. You might also want have the change made to the upstream repo as well. I don't normally run SELinux distros and I don't know much about SELinux anyway so I'd rather not request it myself. I wouldn't see any problems that change might create. |
Thank you @JuhaSointusalo, I will take care of updating both Fedora and upstream SELinux rules |
boinc no longer needs permissions to run stat command on /dev/input/* BOINC/boinc#2463 Signed-off-by: Germano Massullo <[email protected]>
boinc no longer needs permissions to run stat command on /dev/input/* BOINC/boinc#2463 Note: the affected boinc code never worked BOINC/boinc#1187 BOINC/boinc#2335 Upstream pull request OwlCyberDefense/refpolicy-contrib#68 Signed-off-by: Germano Massullo <[email protected]>
boinc no longer needs permissions to run stat command on /dev/input/* BOINC/boinc#2463 Note: the affected boinc code never worked BOINC/boinc#1187 BOINC/boinc#2335 Upstream pull request OwlCyberDefense/refpolicy-contrib#68 Signed-off-by: Germano Massullo <[email protected]>
boinc no longer needs permissions to run stat command on /dev/input/* BOINC/boinc#2463 Note: the affected boinc code never worked BOINC/boinc#1187 BOINC/boinc#2335 Upstream pull request OwlCyberDefense/refpolicy-contrib#68 Signed-off-by: Germano Massullo <[email protected]>
@davidpanderson or @CharlieFenton or @lfield - can one of you review this code and confirm it is good to merge? I'm not familiar enough with this level of linux to make the call. |
I think is is ok. AFAIK looking at /dev/input doesn't work. It only makes sense to get the idle time from the xserver. |
Are there any systems where LINUX_LIKE_SYSTEM is defined and this works?
(Any compiler with __GNU__ defined is Linux like, according to BOINC)
…On Thu, May 3, 2018 at 7:23 AM, lfield ***@***.***> wrote:
I think is is ok. AFAIK looking at /dev/input doesn't work. It only makes
sense to get the idle time from the xserver.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2463 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKXcsgz91gcOt_2HX9vBxDKoADqEX4eyks5tuxL1gaJpZM4TO_wz>
.
--
Eric Korpela
[email protected]
AST:7731^29u18e3
|
I had checked CentOS 4.8 and 5.11; Debian 5 and 9; Fedora 27; Mandrake 10.1; Mint 10 (=Ubuntu 10.10), 11, 14, 16 and 17 (=Ubuntu 14.04) and Scientific Linux 6.3. The oldest kernel was 2.6.8 from around 2004. I didn't think to check Android. Android has more security features enabled than average desktop Linux so I would be surprised if the code worked on Android even if the Android/Linux kernel somehow otherwise was updating I also checked FreeBSD 11.1; NetBSD 7.1.2; OpenBSD 6.3 and Solaris 11.3. None had I didn't check AIX or HP-UX because they don't run on x86. Haiku is open-source clone of BeOS which I think was it's own kind of OS and probably didn't have Anything else? The interesting kernel files are |
I also am not familiar with this level of Linux. |
IMHO the best solution for Linux idle detection is using logind features. Read: #1187 (comment) |
One way to look at this is to run The rest is just that I wasn't satisfied with "doesn't work at all" and needed to explain to myself why the code doesn't work when the similar code for TTYs does work. |
@JuhaSointusalo - can you let me know the status of this? Is there anything pending that you need to do and if it is ready - who do you think the most suitable reviewers are? Thanks! |
It's ready.
Anyone who can check that the code doesn't work anywhere. |
@lfield - would you be willing to review and merge if you are ok with it? I don't know linux at this level well enough to feel comfortable doing the review and merge. |
I am fine with this change. We can only test on a limited set of machines this will be merged for wider testing. |
This is an example of the sort of change which should be tested from master, long before the next release branch is forked. Otherwise, we fall foul of "Too early to test, too late to change". |
@lfield - did you mean to merge the pull request or close it? |
The code tries to open /dev/input/mice as if it was a directory. If
there are no input devices, like in a headless machine, the code
repeatedly tries to make a list of input devices. On Debian, these bugs,
together with Debian's patches to BOINC, result in useless error
messages in client's log.
On SELinux systems, services can access device nodes in /dev/input/ only
if given that right in SELinux configuration. On some Fedora versions
BOINC client doesn't have that right and the code results in numerous
SELinux warnings. These warnings in turn result in high CPU usage when
the system analyzes the warnings.
Furthermore, the code doesn't work at all. The code expects that input
drivers update timestamps on device nodes when the drivers receive input
from devices. The input drivers however have no such code. Checking
driver commit logs suggest that if such code ever existed it was so long
time ago that we don't need to care about it and testing distros of
various ages confirms that.
Since the code doesn't and can't work solve the problems on Debian and
Fedora by just removing the code altogether. The code was only used on
Linux and /dev/input/ seems to be Linux only thing anyway.
Note that the client has similar code for checking terminal devices.
Contrary to the input device code that code does work correctly. This is
because programs running on a terminal have their inputs and outputs
connected to the terminal device node. Input to or output from a program
results in a read from or write to device node and terminal drivers do
have code that updates timestamps on reads and writes.
Closes #2335.
See #1187.