Fixing unprivileged mount -o remount,ro
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | mnt: Only change user settable mount flags in remountfs/ include/ | +4 | 2 replies | |
| 2/5 | mnt: Move the test for MNT_LOCK_READONLY from change_mount_flags into do_remountfs/ | +10 | 1 reply | |
| 3/5 | mnt: Correct permission checks in do_remountfs/ include/ | +38 | 1 reply | |
| 4/5 | mnt: Change the default remount atime from relatime to the existing valuefs/ | +8 | 1 reply | |
| 5/5 | mnt: Add tests for unprivileged remount cases that have found to be faultytools/ tools/ tools/ | +260 | 3 replies |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Serge E. Hallyn |
|---|---|
| 1/5 | A-b |
| 2/5 | A-b |
| 3/5 | A-b |
| 4/5 | A-b |
| 5/5 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [REVIEW][0/5] Fixing unprivileged mount -o remount,ro
This patchset addresses a nasty bug where
"unshare --user --mount mount --bind -o remount,ro /path" would allow a following "mount --bind -o remount,rw" to succeed even when /path started out read-only in the initial mount namespace.
The fixes are quite simple and since they are user namespace specific I plan on carrying them in my user namespace tree and ultimately pushing them to Linus.
If anyone has any concerns about the code before I do that please speak up so the issues can be addressed.
Eric W. Biederman (5):
mnt: Only change user settable mount flags in remount
mnt: Move the test for MNT_LOCK_READONLY from change_mount_flags into do_remount
mnt: Correct permission checks in do_remount
mnt: Change the default remount atime from relatime to the existing value
mnt: Add tests for unprivileged remount cases that have found to be faulty
fs/namespace.c | 59 ++++- include/linux/mount.h | 9 +- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/mount/Makefile | 17 ++ .../selftests/mount/unprivileged-remount-test.c | 242 +++++++++++++++++++++ 5 files changed, 320 insertions(+), 8 deletions(-)
Eric