E Eric W. Biederman #
Message details and related content
Date: Fri, 22 May 2015 15:41:45 -0500 (4 weeks, 6 days, 23 hours ago) Linus, Please pull the for-linus branch from the git tree: git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git for-linus HEAD: 81909cb3350299977a88f72264651f6cec06c836 mnt: Avoid unnecessary regressions in fs_fully_visible Long ago and far away when user namespaces where young and I was a more optimistic man it was realized that allowing fresh mounts of proc and sysfs with only user namespace permissions could violate the basic rule that only root gets to decide if proc or sysfs should be mounted at all. Some hacks were put in place to reduce the worst of the damage could be done, and the common sense rule was adopted that fresh mounts of proc and sysfs should allow no more than bind mounts of proc and sysfs. Unfortunately that rule has not been fully enforced. There are two kinds of gaps in that enforcement. Only filesystems mount on empty directories on proc and sysfs should be ignored but the test for empty directories was insufficient. So this patchset requires directories on proc, sysctl and sysfs that are will always be empty to be created specially. Every other technique is lossy as an ordinary directory can dynamically be added to later. This actually makes this code in the kernel a smidge clearer about it's purpose. I asked container developers from the various container projects to help test this and no holes were found in the set of mount points on proc and sysfs that this patchset identifies. This set of changes also starts enforcing the mount flags of fresh mounts of proc and sysfs are consistent with the existing mount of proc and sysfs. I expected this to be the boring part of this patchset but unfortunately userspace has been stupid and extra work has to be done to avoid regressions. The atime, read-only, and nodev attributes were not a problem and as such are enforced absolutely. People have been winding up mounting proc and sysfs in contaners with