Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionJan Pazdziora (Red Hat)
2014-07-02 14:35:15 UTC
Description of problem:
Attempt to start /bin/dbus-daemon --system --fork in a container leaves no process running. Stracing the process shows message Failed to drop capabilities: Operation not permitted.
Version-Release number of selected component (if applicable):
3.10.0-123.el7.x86_64 on the host
docker-0.11.1-22.el7.x86_64 on the host
dbus-1.6.12-8.el7.x86_64 in the container
How reproducible:
Deterministic.
Steps to Reproduce:
1. Run strace -s 500 -f -o /tmp/dbus.strace /bin/dbus-daemon --system --fork
2. Check /tmp/dbus.strace
Actual results:
54 geteuid() = 0
54 capget({0 /* _LINUX_CAPABILITY_VERSION_??? */, 0}, NULL) = 0
54 gettid() = 54
54 prctl(PR_SET_KEEPCAPS, 1) = 0
54 capset({_LINUX_CAPABILITY_VERSION_3, 54}, {CAP_SETGID|CAP_SETUID|CAP_AUDIT_WRITE, CAP_SETGID|CAP_SETUID|CAP_AUDIT_WRITE, 0}) = -1 EPERM (Operation not permitted)
54 epoll_ctl(3, EPOLL_CTL_DEL, 4, {0, {u32=0, u64=0}}) = 0
54 close(4) = 0
54 unlink("/var/run/dbus/system_bus_socket") = 0
54 unlink("/var/run/messagebus.pid") = 0
54 write(2, "Failed to start message bus: Failed to drop capabilities: Operation not permitted\n\n", 83) = 83
54 exit_group(1) = ?
The matching piece of source seems to be
capng_clear (CAPNG_SELECT_BOTH);
capng_update (CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED,
CAP_AUDIT_WRITE);
rc = capng_change_id (uid, gid, CAPNG_DROP_SUPP_GRP);
if (rc)
{
switch (rc) {
default:
dbus_set_error (error, DBUS_ERROR_FAILED,
"Failed to drop capabilities: %s\n",
_dbus_strerror (errno));
break;
Expected results:
Dropping capabilities seems like an operation that should pass in a container.
Additional info:
Comment 1Jan Pazdziora (Red Hat)
2014-07-02 14:36:48 UTC
Or does it actually fail because CAP_AUDIT_WRITE is being added?
Docker just added support for --cap-add which you should be able to figure out which capability you are missing. You should be able to drop caps but you might not have all of the caps you need.
but using --cap-add will permanently add that capability to the container, which could be a security risk. :/
I was able to start the dbus-daemon without the capability and just faking the library calls for dbus-daemon.
Comment 13Jan Pazdziora (Red Hat)
2014-08-14 13:22:04 UTC
(In reply to Daniel Walsh from comment #12)
> Fixed in docker-1.1.2-8.el7.x86_64
Confirming that with this daemon, dbus-daemon process starts and is running.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2014-1266.html
Description of problem: Attempt to start /bin/dbus-daemon --system --fork in a container leaves no process running. Stracing the process shows message Failed to drop capabilities: Operation not permitted. Version-Release number of selected component (if applicable): 3.10.0-123.el7.x86_64 on the host docker-0.11.1-22.el7.x86_64 on the host dbus-1.6.12-8.el7.x86_64 in the container How reproducible: Deterministic. Steps to Reproduce: 1. Run strace -s 500 -f -o /tmp/dbus.strace /bin/dbus-daemon --system --fork 2. Check /tmp/dbus.strace Actual results: 54 geteuid() = 0 54 capget({0 /* _LINUX_CAPABILITY_VERSION_??? */, 0}, NULL) = 0 54 gettid() = 54 54 prctl(PR_SET_KEEPCAPS, 1) = 0 54 capset({_LINUX_CAPABILITY_VERSION_3, 54}, {CAP_SETGID|CAP_SETUID|CAP_AUDIT_WRITE, CAP_SETGID|CAP_SETUID|CAP_AUDIT_WRITE, 0}) = -1 EPERM (Operation not permitted) 54 epoll_ctl(3, EPOLL_CTL_DEL, 4, {0, {u32=0, u64=0}}) = 0 54 close(4) = 0 54 unlink("/var/run/dbus/system_bus_socket") = 0 54 unlink("/var/run/messagebus.pid") = 0 54 write(2, "Failed to start message bus: Failed to drop capabilities: Operation not permitted\n\n", 83) = 83 54 exit_group(1) = ? The matching piece of source seems to be capng_clear (CAPNG_SELECT_BOTH); capng_update (CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED, CAP_AUDIT_WRITE); rc = capng_change_id (uid, gid, CAPNG_DROP_SUPP_GRP); if (rc) { switch (rc) { default: dbus_set_error (error, DBUS_ERROR_FAILED, "Failed to drop capabilities: %s\n", _dbus_strerror (errno)); break; Expected results: Dropping capabilities seems like an operation that should pass in a container. Additional info: