Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 846635 - sys-process/htop-3.1.2: Need file capabilities to show swap usage of all processes
Summary: sys-process/htop-3.1.2: Need file capabilities to show swap usage of all proc...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-21 05:38 UTC by Dan Moulding
Modified: 2022-06-29 07:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Moulding 2022-05-21 05:38:59 UTC
When the M_SWAP column is enabled, it shows swap usage of processes. However, without cap_sys_ptrace, htop cannot show the swap usage of processes owned by other users. The SWAP column will simply show 0 bytes for other users' processes.

If the cap_sys_ptrace file capability is added to the htop binary, then any user can see the amount of swap used by all processes.

The ebuild for htop ought to add that file capability to the binary so that the M_SWAP column will work as intended. Gentoo users that wish to not add that file capability, could do so by disabling the filecaps USE flag on the package.

Reproducible: Always

Steps to Reproduce:
1. As root, run some memory heavy processes so that swap is utilized by them. Virtual machines (e.g. qemu) are a good candidate.
2. As an unprivileged user, run htop and enable the M_SWAP column
3. Note that the SWAP column will show 0 for the root processes that are using SWAP
4. As root, run htop and enable the M_SWAP column
5. Not that now the SWAP column will show actual swap usage for root (and all other) processes
Actual Results:  
The SWAP column doesn't show correct swap usage for all processes.

Expected Results:  
The SWAP column should show correct swap usage for all processes.
Comment 1 Larry the Git Cow gentoo-dev 2022-05-21 08:35:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5325dae5e32f45af0a3c9805d7e37ba3b594f1b6

commit 5325dae5e32f45af0a3c9805d7e37ba3b594f1b6
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2022-05-21 08:20:22 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2022-05-21 08:34:59 +0000

    sys-process/htop: Added live ebuild
    
    Introducing cap_sys_ptrace file capability for htop
    
    Bug: https://bugs.gentoo.org/846635
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-process/htop/htop-9999.ebuild | 113 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)