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 1603201 - [Regression] docker can't bindmount symbolic links to namespaces (/proc/PID/ns/*)
Summary: [Regression] docker can't bindmount symbolic links to namespaces (/proc/PID/n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: ---
Assignee: Frantisek Kluknavsky
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1571903
TreeView+ depends on / blocked
 
Reported: 2018-07-19 12:41 UTC by Sergio Lopez
Modified: 2021-12-10 16:42 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, bind mounts were resolved before using them inside a container. Consequently, symlinks could not be mounted inside of the container. With this update, the source of a bind mount is not resolved. As a result, it is possible to bind mount symlinks again into a container.
Clone Of:
Environment:
Last Closed: 2018-08-16 16:05:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2482 0 None None None 2018-08-16 16:06:42 UTC

Description Sergio Lopez 2018-07-19 12:41:53 UTC
Description of problem:

Starting on version docker-1.13.1-63.git94f4240.el7.x86_64, docker can't no longer bindmount symbolic links to namespaces (/proc/PID/ns/*):

# docker run --privileged -it  -v /proc/1/ns/net:/aaa rhel7 /bin/bash
/usr/bin/docker-current: Error response from daemon: error while creating mount source path '/proc/1/ns/net:[4026531956]': mkdir /proc/1/ns/net:[4026531956]: no such file or directory.

This worked on previous versions (docker-1.13.1-58.git87f2fab.el7.x86_64 or lower).


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

docker-1.13.1-63.git94f4240.el7.x86_64


How reproducible:

Always.


Additional info:

This problem can be tracked down to this change:

 - https://github.com/projectatomic/docker/commit/1fc7510329f938b7d38fd8989bd462201d0fe13a

volume/volume.go:
 // Setup sets up a mount point by either mounting the volume if it is
 // configured, or creating the source directory if supplied.
-func (m *MountPoint) Setup(mountLabel string, rootUID, rootGID int) (path string, err error) {
+func (m *MountPoint) Setup(prefix, mountLabel string, rootUID, rootGID int) (path string, err error) {
+	symlinkRoot := prefix
+	if symlinkRoot == "" {
+		symlinkRoot = "/"
+	}
+	sourcePath, err := symlink.FollowSymlinkInScope(filepath.Join(prefix, m.Source), symlinkRoot)
+	if err != nil {
+		path = ""
+		err = errors.Wrapf(err, "error evaluating symlink from mount source '%s'", m.Source)
+		return
+	}
+

The use of FollowSymlinkInScope on m.Source alters docker's by following symlinks in the source path of the bindmount. In the case of a symbolic link to a namespace, it produces the following transformation:

 - /proc/1/ns/net -> /proc/1/ns/net:[4026531956]

And the later doesn't really exist in the filesystem.

I've checked upstream, and this change isn't there, so this is a downstream regression.

Comment 4 Giuseppe Scrivano 2018-07-19 14:29:44 UTC
Pull requests here:

https://github.com/projectatomic/docker/pull/316
https://github.com/projectatomic/docker/pull/317

Sergio, we are using this feature in the docker system container, so this is probably not useful upstream.

Comment 5 Sergio Lopez 2018-07-19 14:41:10 UTC
Hi Giuseppe,

Thanks for the explanation and the quick fix. I'll create a test build once the PRs are merged.

Sergio (slp).

Comment 19 Luwen Su 2018-08-05 17:36:31 UTC
Package version:
docker-1.13.1-74.git6e3bb8e.el7.x86_64

# docker run --privileged -it  -v /proc/1/ns/net:/aaa rhel7 /bin/bash
[root@ab28cbc039d9 /]# ls /aaa
/aaa
[root@ab28cbc039d9 /]# exit
exit

Comment 22 errata-xmlrpc 2018-08-16 16:05:57 UTC
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.

https://access.redhat.com/errata/RHSA-2018:2482


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