This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2127950 - Package needs to be recompiled to list capability 40 properly
Summary: Package needs to be recompiled to list capability 40 properly
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libcap-ng
Version: 9.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Anderson Sasaki
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-19 12:49 UTC by Renaud Métrich
Modified: 2023-09-24 16:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-01 22:42:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-1839 0 None Migrated None 2023-09-01 22:38:02 UTC
Red Hat Issue Tracker RHELPLAN-134318 0 None None None 2022-09-19 12:56:00 UTC
Red Hat Issue Tracker SECENGSP-4806 0 None None None 2022-09-19 12:56:02 UTC

Description Renaud Métrich 2022-09-19 12:49:43 UTC
Description of problem:

"setpriv --list-caps" relies on libcap-ng library to print the mapping between the capability number and human-readable string, e.g.:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# /usr/bin/setpriv --list-caps
chown
dac_override
dac_read_search
 :
perfmon
bpf
cap_40
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

On RHEL8.5+, the last capability is displayed as "cap_40" instead of "checkpoint_restore" because the static table "captab" doesn't contain the entry:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# gdb --args /usr/bin/setpriv --list-caps
[...]
(gdb) break capng_lookup_number
(gdb) run

(gdb) p captab
$4 = {{value = 0, offset = 0}, {value = 1, offset = 6}, {value = 2, offset = 19}, {value = 3, offset = 35}, {
    value = 4, offset = 42}, {value = 5, offset = 49}, {value = 6, offset = 54}, {value = 7, offset = 61}, {
    value = 8, offset = 68}, {value = 9, offset = 76}, {value = 10, offset = 92}, {value = 11, offset = 109}, {
    value = 12, offset = 123}, {value = 13, offset = 133}, {value = 14, offset = 141}, {value = 15, offset = 150}, {
    value = 16, offset = 160}, {value = 17, offset = 171}, {value = 18, offset = 181}, {value = 19, offset = 192}, {
    value = 20, offset = 203}, {value = 21, offset = 213}, {value = 22, offset = 223}, {value = 23, offset = 232}, {
    value = 24, offset = 241}, {value = 25, offset = 254}, {value = 26, offset = 263}, {value = 27, offset = 278}, {
    value = 28, offset = 284}, {value = 29, offset = 290}, {value = 30, offset = 302}, {value = 31, offset = 316}, {
    value = 32, offset = 324}, {value = 33, offset = 337}, {value = 34, offset = 347}, {value = 35, offset = 354}, {
    value = 36, offset = 365}, {value = 37, offset = 379}, {value = 38, offset = 390}, {value = 39, offset = 398}}
(gdb) p captab_msgstr
$5 = {{str23 = "chown", str24 = "dac_override", str25 = "dac_read_search", str26 = "fowner", str27 = "fsetid", 
    str28 = "kill", str29 = "setgid", str30 = "setuid", str31 = "setpcap", str32 = "linux_immutable", 
    str33 = "net_bind_service", str34 = "net_broadcast", str35 = "net_admin", str36 = "net_raw", str37 = "ipc_lock", 
    str38 = "ipc_owner", str39 = "sys_module", str40 = "sys_rawio", str41 = "sys_chroot", str42 = "sys_ptrace", 
    str43 = "sys_pacct", str44 = "sys_admin", str45 = "sys_boot", str46 = "sys_nice", str47 = "sys_resource", 
    str48 = "sys_time", str49 = "sys_tty_config", str50 = "mknod", str51 = "lease", str52 = "audit_write", 
    str53 = "audit_control", str55 = "setfcap", str58 = "mac_override", str61 = "mac_admin", str64 = "syslog", 
    str67 = "wake_alarm", str76 = "block_suspend", str79 = "audit_read", str82 = "perfmon", str85 = "bpf"}, 
  str = 0x7ffff7bccb80 <captab_msgstr> "chown"}
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Here above we can see it doesn't know capability 40 at all.

The reason for this is having built the library in an environment installed with kernel-headers-4.18.0-310.el8.x86_64, which didn't have CAP_CHECKPOINT_RESTORE:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# rpm2cpio ../kernel-headers-4.18.0-310.el8.x86_64.rpm | cpio -icdmu
10493 blocks

# grep -B 4 CAP_LAST_CAP usr/include/linux/capability.h
 * CAP_NET_ADMIN and CAP_BPF are required to load networking programs.
 */
#define CAP_BPF			39

#define CAP_LAST_CAP         CAP_BPF

#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Building locally on my test system running RHEL8.6 shows the capability being present, which confirms the root cause.

Please rebuild the library ASAP.

Version-Release number of selected component (if applicable):

libcap-ng-0.7.11-1.el8.x86_64
kernel-4.18.0-348.el8 and later

How reproducible:

Always, see above.

Comment 2 Anderson Sasaki 2023-08-30 14:56:12 UTC
Moving to RHEL 9 as we do not plan to do any other non-critical bugfixes in RHEL8.

Comment 3 RHEL Program Management 2023-09-01 22:37:23 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-01 22:42:25 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.

Users watching this BZ may not be automatically added to the Jira ticket.  Be sure to add yourself to the Watchers field in the Jira issue if you desire to continue following this issue.


Note You need to log in before you can comment on or make changes to this bug.