Re: [PATCH] fuse: fix illegal access to inode with reused nodeid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 18, 2021 at 12:28 AM Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:
>
> On Wed, Jun 09, 2021 at 09:11:58PM +0300, Amir Goldstein wrote:
> > Server responds to LOOKUP and other ops (READDIRPLUS/CREATE/MKNOD/...)
> > with outarg containing nodeid and generation.
> >
> > If a fuse inode is found in inode cache with the same nodeid but
> > different generation, the existing fuse inode should be unhashed and
> > marked "bad" and a new inode with the new generation should be hashed
> > instead.
> >
> > This can happen, for example, with passhrough fuse filesystem that
> > returns the real filesystem ino/generation on lookup and where real inode
> > numbers can get recycled due to real files being unlinked not via the fuse
> > passthrough filesystem.
>
> Hi Amir,
>
> Is the code for filesystem you have written is public? If yes, can you
> please provide a link.

Yes, I provided the link in the discussion about the bug:

[1] https://github.com/amir73il/libfuse/commits/cachegwfs

>
> Is there an API to lookup generation number from host filesystem. Or

There is FS_IOC_GETVERSION which a few fs implement
(ext4/xfs/btrfs/f2fs), but I don't use it.

> that's something your file server updates based on file handle has
> changed.
>

My filesystem takes ino/gen from file handle.
The file handle format is filesystem specific - but my filesystem only
has support for ext4 and xfs, so it makes used of that to extract
the generation from file handle.

When inode number is 32bit (ext4) the entire file handle is encoded
into 64bit nodeid.

Thanks,
Amir.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux