diff options
author | Michael Weiß <michael.weiss@aisec.fraunhofer.de> | 2022-10-24 21:15:52 +0200 |
---|---|---|
committer | Christian Brauner (Microsoft) <brauner@kernel.org> | 2022-11-07 10:24:22 +0100 |
commit | 42da66ac7bcb19181385e851094ceedfe7c81984 (patch) | |
tree | 8aa20b43ac0678d30061832706ff8c74b469c02f /drivers/hid/hid-cp2112.c | |
parent | 9abf2313adc1ca1b6180c508c25f22f9395cc780 (diff) |
squashfs: enable idmapped mounts
For squashfs all needed functionality for idmapped mounts is already
implemented by the generic handlers in the VFS. Thus, it is sufficient
to just enable the corresponding FS_ALLOW_IDMAP flag to support
idmapped mounts.
We use this for unprivileged (user namespaced) containers based on
squashfs images as rootfs in GyroidOS.
A simple test using the mount-idmapped tool executed as user with
uid=1000 looks as follows:
$ mkdir test
$ echo "test" > test/test_file
$ mksquashfs test/ fs.img
$ sudo mkdir /mnt/test
$ sudo mkdir /mnt/mapped
$ sudo mount fs.img -o loop /mnt/test/
$ sudo ./mount-idmapped --map-mount b:1000:2000:1 /mnt/test/ /mnt/mapped/
$ mount | tail -n2
fs.img on /mnt/test type squashfs (ro,relatime,errors=continue)
fs.img on /mnt/mapped type squashfs (ro,relatime,idmapped,errors=continue)
$ ls -lan /mnt/test/
total 5
drwxr-xr-x 2 1000 1000 32 Okt 24 13:36 .
drwxr-xr-x 6 0 0 4096 Okt 24 13:38 ..
-rw-r--r-- 1 1000 1000 5 Okt 24 13:36 test_file
$ ls -lan /mnt/mapped/
total 5
drwxr-xr-x 2 2000 2000 32 Okt 24 13:36 .
drwxr-xr-x 6 0 0 4096 Okt 24 13:38 ..
-rw-r--r-- 1 2000 2000 5 Okt 24 13:36 test_file
Signed-off-by: Michael Weiß <michael.weiss@aisec.fraunhofer.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'drivers/hid/hid-cp2112.c')
0 files changed, 0 insertions, 0 deletions