Re: [PATCH V2] orangefs: posix open permission checking

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

 



On Mon, Nov 25, 2019 at 7:12 AM <hubcap@xxxxxxxxxx> wrote:
>
> @@ -90,6 +90,8 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode,
>                 new_op->upcall.uid = from_kuid(&init_user_ns, wr->uid);
>                 new_op->upcall.gid = from_kgid(&init_user_ns, wr->gid);
>         }
> +       if (new_op->upcall.uid && (ORANGEFS_I(inode)->opened))
> +               new_op->upcall.uid = 0;

You still can't do this.

You can't make it part of the inode state, because the inode is shared
across different file descriptors. So you are giving a potentially
different file descriptor (that really was opened just for reading)
the magical override.

What you *should* do is to always use the credentials at open time,
and the "can I read or write this" from open time.

And regardless of whether you have your own open routine or not, those
are always available as "file->f_mode & FMODE_WRITE" and
"file->f_cred".

If you use those - and pretty much *ONLY* if you use those - you will
get things right.

             Linus



[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