Bug#862461: tiptop: requires root to run
tags 862461 + patch thanks I agree with Nathaniel, the currently displayed message is too confusing for regular users. A proper message should be displayed, even if it means a (small!) deviation from upstream. I am attaching a patch here, please consider! Description: Report that root access is required When perf_event_paranoid level is set to 3 (default), tiptop requires root access to be run (#862461). Notify the user accordingly. Author: Gunnar WolfOrigin: vendor https://bugs.debian.org/862461 Bug-Debian: https://bugs.debian.org/862461 Forwarded: no Reviewed-By: Gunnar Wolf Last-Update: 2017-10-31 Index: tiptop-2.3.1/src/requisite.c === --- tiptop-2.3.1.orig/src/requisite.c +++ tiptop-2.3.1/src/requisite.c @@ -69,8 +69,11 @@ int check() else if (strcmp(os.release, "2.6.31") < 0) { /* lexicographic order */ fprintf(stderr, "Linux 2.6.31+ is required, OS reports '%s'.\n", os.release); -} -else { +} else if (paranoia_level == 3) { + fprintf(stderr, "Your kernel is set with an event paranoia value of 3\n"); + fprintf(stderr, "Either run this program as root, or set a lower\n"); + fprintf(stderr, "paranoia value at '%s'.\n", PARANOID2); +} else { fprintf(stderr, "Don't know why...\n"); } exit(EXIT_FAILURE); signature.asc Description: PGP signature
Bug#862461: tiptop: requires root to run
Dear Thomasz and Ben, Many thanks for the explanation. I can confirm that the workaround is effective. (In hindsight the man page has somewhat documented this behavior under the ``--kernel'' flag.) The only thing I have to add is that an edit to this part of the man page may be in order: Unless tiptop is run by root, or the executable is setuid-root, a user can only monitor the tasks it owns. I don't think adding the workaround to the man page is necessary, but it would be good to know that by default tiptop requires root to monitor any tasks at all. Also, if upstream is amenable, a more specific error message would be great. Cheers, Nathaniel On 05/15/2017 01:35 AM, Tomasz Buchert wrote: On 14/05/17 20:58, Ben Hutchings wrote: On Sun, 2017-05-14 at 10:43 +0200, Tomasz Buchert wrote: On 12/05/17 18:54, Nathaniel Beaver wrote: [...] Thank you, Nathaniel. I confirm the problem. A safe bet is that https://lkml.org/lkml/2016/1/11/587 is the cause. You can verify that /proc/sys/kernel/perf_event_paranoid contains "3". By running echo 2 | sudo tee /proc/sys/kernel/perf_event_paranoid you should be able to use tiptop as a normal user again. I doubt that we can switch the default value in Debian kernels to "2", so I have to say that simply the tiptop website is not up-to-date, at least with respect to the Debian kernels (but also likely to other distributions as well). I'm CCing Ben to let him comment on this. The Debian kernel default is not going to be changed in the short term. In the long term it's conceivable that performance events will eventually become sufficiently robust that it would be reasonable to change the default. Ben. -- Ben Hutchings - Debian developer, member of kernel, installer and LTS teams Thank you! Nathaniel, I'll keep this bug open till possibly the perf events will become available for normal users. Till then I require you to use the workaround above if you feel like it. Cheers, Tomasz
Bug#862461: tiptop: requires root to run
On 14/05/17 20:58, Ben Hutchings wrote: > On Sun, 2017-05-14 at 10:43 +0200, Tomasz Buchert wrote: > > On 12/05/17 18:54, Nathaniel Beaver wrote: > > > [...] > > > > Thank you, Nathaniel. > > > > I confirm the problem. A safe bet is that > > https://lkml.org/lkml/2016/1/11/587 is the cause. You can verify that > > /proc/sys/kernel/perf_event_paranoid contains "3". By running > > > > echo 2 | sudo tee /proc/sys/kernel/perf_event_paranoid > > > > you should be able to use tiptop as a normal user again. > > > > I doubt that we can switch the default value in Debian kernels to "2", > > so I have to say that simply the tiptop website is not up-to-date, at > > least with respect to the Debian kernels (but also likely to other > > distributions as well). I'm CCing Ben to let him comment on this. > > The Debian kernel default is not going to be changed in the short term. > In the long term it's conceivable that performance events will > eventually become sufficiently robust that it would be reasonable to > change the default. > > Ben. > > -- > Ben Hutchings - Debian developer, member of kernel, installer and LTS teams Thank you! Nathaniel, I'll keep this bug open till possibly the perf events will become available for normal users. Till then I require you to use the workaround above if you feel like it. Cheers, Tomasz signature.asc Description: PGP signature
Bug#862461: tiptop: requires root to run
On Sun, 2017-05-14 at 10:43 +0200, Tomasz Buchert wrote: > On 12/05/17 18:54, Nathaniel Beaver wrote: > > [...] > > Thank you, Nathaniel. > > I confirm the problem. A safe bet is that > https://lkml.org/lkml/2016/1/11/587 is the cause. You can verify that > /proc/sys/kernel/perf_event_paranoid contains "3". By running > > echo 2 | sudo tee /proc/sys/kernel/perf_event_paranoid > > you should be able to use tiptop as a normal user again. > > I doubt that we can switch the default value in Debian kernels to "2", > so I have to say that simply the tiptop website is not up-to-date, at > least with respect to the Debian kernels (but also likely to other > distributions as well). I'm CCing Ben to let him comment on this. The Debian kernel default is not going to be changed in the short term. In the long term it's conceivable that performance events will eventually become sufficiently robust that it would be reasonable to change the default. Ben. -- Ben Hutchings - Debian developer, member of kernel, installer and LTS teams signature.asc Description: This is a digitally signed message part
Bug#862461: tiptop: requires root to run
On 12/05/17 18:54, Nathaniel Beaver wrote: > [...] Thank you, Nathaniel. I confirm the problem. A safe bet is that https://lkml.org/lkml/2016/1/11/587 is the cause. You can verify that /proc/sys/kernel/perf_event_paranoid contains "3". By running echo 2 | sudo tee /proc/sys/kernel/perf_event_paranoid you should be able to use tiptop as a normal user again. I doubt that we can switch the default value in Debian kernels to "2", so I have to say that simply the tiptop website is not up-to-date, at least with respect to the Debian kernels (but also likely to other distributions as well). I'm CCing Ben to let him comment on this. Cheers, Tomasz signature.asc Description: PGP signature
Bug#862461: tiptop: requires root to run
Package: tiptop Version: 2.2-2 Severity: important Dear Maintainer, Running tiptop results in a return status of 1 and this on stderr: syscall: Operation not permitted Could not perform syscall. Don't know why... It runs as expected as root or using sudo. The homepage for tiptop lists "No root privilege needed" as a feature, so this is not expected behavior. Sincerely, Nathaniel Beaver -- System Information: Debian Release: 8.8 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.8.0-0.bpo.2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages tiptop depends on: ii libc62.19-18+deb8u9 ii libncurses5 5.9+20140913-1+b1 ii libtinfo55.9+20140913-1+b1 ii libxml2 2.9.1+dfsg1-5+deb8u4 tiptop recommends no packages. tiptop suggests no packages. -- no debconf information