rm -r * fails to delete directories when using overlayfs in a user-namespace
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Medium
|
Andy Whitcroft |
Bug Description
rm -r * fails to delete directories when using overlayfs in a user-namespace.
If overlayfs is mounted as follows,
mount -n -t overlay overlay -o lowerdir=
and if lowerdir contains lowerdir/
rm -r mntpt/foo
fails with error message,
"rm: cannot remove ‘mntpt/foo’: Operation not permitted"
strace shows,
unlinkat(
OS details: 64-bit ubuntu 14.04.2 with the linux-generic-
The bug does not occur on ubuntu 14.04.2 with the default linux-generic 3.13 kernel.
The bug occurs for any vanilla 3.18+ kernel to which the 1-line patch, "overlayfs: allow unprivileged mounts" is added. (The patch is at, http://
The bug occurs regardless of whether the filesystem underlying overlayfs is tmpfs or ext4.
The bug also occurs when running ubuntu 15.04 (ubuntu vivid) in a virtual machine (qemu-system-
A script which reproduces the bug is attached and is also available at http://
Hardware: intel core2 duo processor in a macbook-4.1
Changed in linux (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Andy Whitcroft (apw) |
milestone: | none → ubuntu-15.08 |
description: | updated |
tags: | added: bot-stop-nagging |
description: | updated |
Changed in linux (Ubuntu): | |
milestone: | ubuntu-15.08 → ubuntu-15.09 |
Changed in linux (Ubuntu): | |
milestone: | ubuntu-15.09 → ubuntu-15.10 |
Changed in linux (Ubuntu): | |
milestone: | ubuntu-15.10 → ubuntu-15.11 |
no longer affects: | lxc (Ubuntu) |
Changed in lxc (Ubuntu): | |
status: | New → Confirmed |
Changed in linux (Ubuntu): | |
milestone: | ubuntu-15.11 → ubuntu-15.12 |
Changed in linux (Ubuntu): | |
milestone: | ubuntu-15.12 → ubuntu-16.01 |
Changed in linux (Ubuntu): | |
milestone: | ubuntu-16.01 → ubuntu-16.02 |
I can reproduce this problem on a fresh machine set-up at AWS (kernel Linux ip-172-31-6-51 3.19.0-26-generic #28~14.04.1-Ubuntu SMP Wed Aug 12 14:09:17 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux).
Below the output of the script reproduction script linked above:
```
mounted overlayfs
ls -RF mntpt
-------------
mntpt:
foo/
mntpt/foo:
bar.txt
rm -r mntpt/*
-------------
rm: cannot remove ‘mntpt/foo’: Operation not permitted
exit code=1
ls -RF mntpt
-------------
mntpt:
foo/
mntpt/foo:
unmounted overlayfs
cleaning up
```