oss-sec mailing list archives

CVE Request: ro bind mount bypass using user namespaces


From: Kenton Varda <kenton () sandstorm io>
Date: Tue, 12 Aug 2014 14:48:28 -0700

Due to a bug in the Linux kernel's implementation of remount, on systems
with unprivileged user namespaces enabled, it is possible for an
unprivileged user to gain write access to any visible read-only bind mount.
It is also possible to bypass flags like nodev, nosuid, and noexec.

This problem affects sandboxing / containerization systems that do not
expose the regular filesystem to the sandboxed process, but do expose a
bind-mounted view of that filesystem using these flags to enforce security.
This bug may enable a sandbox break-out. Sandboxes which have used
seccomp-bpf to disable the "mount" system call or to disable user
namespaces are likely safe.

Eric Biederman has proposed the following patches to fix the problem:

https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/commit/?h=for-linus&id=a6138db815df5ee542d848318e5dae681590fccd
https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/commit/?h=for-linus&id=07b645589dcda8b7a5249e096fece2a67556f0f4
https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/commit/?h=for-linus&id=9566d6742852c527bf5af38af5cbb878dad75705
https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/commit/?h=for-linus&id=ffbc6f0ead47fa5a1dc9642b0331cb75c20a640e
https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/commit/?h=for-linus&id=db181ce011e3c033328608299cd6fac06ea50130

-Kenton Varda, Sandstorm.io

Current thread: