[PATCH v2 0/7] fs/9p: Reuse inode based on path (in addition to qid)
Dominique Martinet
asmadeus at codewreck.org
Sun Sep 13 16:30:09 UTC 2026
Tingmao Wang wrote on Tue, Jul 14, 2026 at 02:14:00AM +0100:
> Does anyone have preferences / suggestions on whether to keep going with
> the path-tracking based approach (perhaps subject to figuring out a way to
> handle parent renames), or an approach where Landlock simply stores the
> fhandle (or (i_ino, i_generation (but this is u32 whereas st_gen within 9p
> is u64))) as the rule key?
st_gen comes from FS_IOC_GETVERSION which is exactly i_generation on at
least ext4/btrfs/xfs, so it's not like that brings you anything
(and it's also stored in the 9p inode's i_generation afaics?)
My understanding is that if the underlying filesystem supports it then
yes mountpoint + i_ino + i_generation ought to be unique when combined
together, but that leaves you with what to do with filesystems that
don't support it (at least tmpfs?) and 9p mounts sharing multiple
filesystems (even if qemu has been warning about it for a while and that
brings its own share of bugs around cache)
If you're fine not supporting them, I think that definitely looks more
promising, but otherwise you don't have much choice
Either way I'm afraid I don't have time to look much into it (I'm afraid
I have to admit I didn't read your full mail, and I have to get up in 4
hours so I should probably stop processing this 9p backlog...), and it
doesn't look like Greg is much more reactive, so you're on your own and
I'm really sorry about it :/
I wish you best though!
> If I find some time over the next couple of weeks I will try out the
> second approach since it might be turning out to be the simpler option,
> but the drawback is that it doesn't enable i/fanotify on 9pfs, which I
> originally hoped to achieve together with fixing Landlock on 9pfs.
(inotify/fanotify would need a protocol overhaul to get "right" and is a
much bigger can of works, because if you get it to work locally then
you'll get people to expect the server to notify clients of remote
changes (some network filesystems can do it with leases, but 9p doesn't
have any such mechanism);
I can understand it is useful even if it only works within the client
local changes but I'm not sure I want to push much here either.)
--
Domnique
More information about the Linux-security-module-archive
mailing list