From: Christian Brauner <brauner@kernel.org>
To: "Michael Weiß" <michael.weiss@aisec.fraunhofer.de>
Cc: Phillip Lougher <phillip@squashfs.org.uk>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Seth Forshee <sforshee@kernel.org>
Subject: Re: [PATCH 1/1] squashfs: enable idmapped mounts
Date: Tue, 25 Oct 2022 09:46:37 +0200 [thread overview]
Message-ID: <20221025074637.v6c243giy7itbimp@wittgenstein> (raw)
In-Reply-To: <20221024191552.55951-1-michael.weiss@aisec.fraunhofer.de>
On Mon, Oct 24, 2022 at 09:15:52PM +0200, Michael Weiß wrote:
> 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>
> ---
This should indeed be all that is needed. Looks good to me,
Reviewed-by: Christian Brauner <brauner@kernel.org>
next parent reply other threads:[~2022-10-25 7:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221024191552.55951-1-michael.weiss@aisec.fraunhofer.de>
2022-10-25 7:46 ` Christian Brauner [this message]
2022-11-06 11:51 ` [PATCH 1/1] squashfs: enable idmapped mounts Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221025074637.v6c243giy7itbimp@wittgenstein \
--to=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.weiss@aisec.fraunhofer.de \
--cc=phillip@squashfs.org.uk \
--cc=sforshee@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).