Re: [PATCH v1 1/2] landlock: Handle weird files

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

 



On Tue, Jan 14, 2025 at 11:15:42PM -0800, Christoph Hellwig wrote:
> On Sat, Jan 11, 2025 at 04:38:56PM +0100, Mickaël Salaün wrote:
> > I guess it depends on the filesystem implementation.  For instance, XFS
> > returns an error if a weird file is detected [1], whereas bcachefs
> > ignores it (which is considered a bug, but not fixed yet) [2].
> 
> If a filesyste, returns an invalid mode that's a file system bug and
> needs to be fixed there.  Warning in a consumer is perfectly fine.
> But the right action in that case is indeed not to grant the access.

Fyi, anonymous inodes traditionally set the mode to 0 which is
really annoying:

lrwx------ 1 root root  64 15. Jan 11:52 94 -> anon_inode:bpf-prog

> sudo stat -L /proc/1/fd/94
  File: /proc/1/fd/94
  Size: 0               Blocks: 0          IO Block: 4096   weird file
Device: 0,15    Inode: 4120        Links: 1
Access: (0600/?rw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2024-11-05 17:15:54.404000000 +0100
Modify: 2024-11-05 17:15:54.404000000 +0100
Change: 2024-11-05 17:15:54.404000000 +0100
 Birth: -





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

  Powered by Linux