setcap does not recognize CAP_PERFMON

Bug #1934608 reported by Nagle-animats
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libcap (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu 20.04 LTS, updated to July 3, 2021.

"setcap" command does not recognize the capability "CAP_PERFMON", in either upper or lower case.
It recognizes other named capabilities.

The same bug has been reported, and fixed, for RedHat/CentOS:

https://bugzilla.redhat.com/show_bug.cgi?id=1946982

Revision history for this message
Nagle-animats (nagle-animats) wrote :

Reproduce by:

echo foo > foo
sudo setcap cap_perfmon+ep foo

Result: "Fatal error: Invalid argument"

sudo setcap cap_net_raw_ep foo

Result: blank (success)

getcap foo
foo = cap_net_raw+ep

So cap_net_raw works, but cap_perfmon is not implemented.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1934608/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Nagle-animats (nagle-animats) wrote :

setcap belongs to the "libcap" package, per "man setcap"

affects: ubuntu → libcap (Ubuntu)
Revision history for this message
Nagle-animats (nagle-animats) wrote :

Reportedly fixed in 21.xx, but broken in 20.04 LTS.

Revision history for this message
Adam Dorsey (adorsey) wrote :

Still broken in 20.04 LTS. Unsure if this is related, but the capabilities man page also does not list CAP_PERFMON. Can the fix from newer versions be backported?

Revision history for this message
Andrew G. Morgan (morganlibcap) wrote :

Modern kernels include:

 CAP_PERFMON = 38 (supported in upstream libcap-2.36)
 CAP_BPF = 39 (supported in upstream libcap-2.37)
 CAP_CHECKPOINT_RESTORE = 40 (supported in upstream libcap-2.43)

If your kernel supports the capability, but your build of libcap does not, you can work around this by specifying the numerical value of the capability instead. For example:

 sudo setcap cap_perfmon+ep foo

can be worked around as:

 sudo setcap 38=ep foo

At time of writing, upstream libcap is at version 2.66.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.