lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YoN5pwgj340Ct4Ye@B-P7TQMD6M-0146.local>
Date:   Tue, 17 May 2022 18:32:07 +0800
From:   Gao Xiang <hsiangkao@...ux.alibaba.com>
To:     Christian Brauner <brauner@...nel.org>
Cc:     fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-erofs@...ts.ozlabs.org, Chao Yu <chao.yu@...o.com>
Subject: Re: [PATCH] erofs: support idmapped mounts

On Tue, May 17, 2022 at 11:22:03AM +0200, Christian Brauner wrote:
> On Tue, May 17, 2022 at 05:15:02PM +0800, Gao Xiang wrote:
> > Hi Christian,
> > 
> > On Tue, May 17, 2022 at 11:06:22AM +0200, Christian Brauner wrote:
> > > On Tue, May 17, 2022 at 03:32:10PM +0800, Chao Yu wrote:
> > > > This patch enables idmapped mounts for erofs, since all dedicated helpers
> > > > for this functionality existsm, so, in this patch we just pass down the
> > > > user_namespace argument from the VFS methods to the relevant helpers.
> > > > 
> > > > Simple idmap example on erofs image:
> > > > 
> > > > 1. mkdir dir
> > > > 2. touch dir/file
> > > > 3. mkfs.erofs erofs.img dir
> > > > 4. mount -t erofs -o loop erofs.img  /mnt/erofs/
> > > > 
> > > > 5. ls -ln /mnt/erofs/
> > > > total 0
> > > > -rw-rw-r-- 1 1000 1000 0 May 17 15:26 file
> > > > 
> > > > 6. mount-idmapped --map-mount b:0:1001:1 /mnt/erofs/ /mnt/scratch_erofs/
> > > > 
> > > > 7. ls -ln /mnt/scratch_erofs/
> > > > total 0
> > > > -rw-rw-r-- 1 65534 65534 0 May 17 15:26 file
> > > 
> > > Your current example maps id 0 in the filesystem to id 1001 in the
> > > mount. But since no files with id 0 exist in the filesystem you're
> > > illustrating that unmapped ids are correctly reported as overflow{g,u}id.
> > > 
> > > I think what you'd rather want to show is something like this:
> > > 
> > > 5. ls -ln /mnt/erofs/
> > > total 0
> > > -rw-rw-r-- 1 1000 1000 0 May 17 15:26 file
> > > 
> > > 6. mount-idmapped --map-mount b:1000:1001:1 /mnt/erofs/ /mnt/scratch_erofs/
> > > 
> > > 7. ls -ln /mnt/scratch_erofs/
> > > total 0
> > > -rw-rw-r-- 1 1001 1001 0 May 17 15:26 file
> > > 
> > > where id 1000 in the filesystem maps to id 1001 in the mount.

Yeah, I just manually tested, although some steps assume user 1000
and some steps assume the root user. But it works.

I will rephrase such commit messages when applying later...

Thanks,
Gao Xiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ