]> git.proxmox.com Git - pve-container.git/commit
bindmount: catch rw/ro race and add tests
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 2 Jun 2016 14:23:09 +0000 (16:23 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jun 2016 05:13:49 +0000 (07:13 +0200)
commit619f27b4fa8a02be2f1b2c5e63e16b6f38dcb4d6
tree81149bf9142abd05f43f9b6846a1087754d1ed15
parent6f85c64e26530eaa5377a884dbce674832f81516
bindmount: catch rw/ro race and add tests

rw/ro race occurs when a container contains the same bind
mount twice and another container contains a bind mount
containing the first container's destination. If the double
bind mounts are both meant to be read-only then the second
container could theoretically swap them out between the
mount and the read-only remount call, then swap them back
for the test. So to verify this we use the same file
descriptor we use for the dev/inode check and perform an
faccessat() call and expect it to return EROFS and nothing
else.

Also include O_NOFOLLOW in the checks' openat() calls.
src/PVE/LXC.pm
src/test/Makefile
src/test/bindmount_test.pl [new file with mode: 0755]