Re: [PATCH bpf-next v3] bpf: Support uid and gid when mounting bpffs

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

 



On Tue, Dec 12, 2023 at 12:21 AM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> I think you want
>
> opt->uid = current_fsuid();
> opt->gid = current_fsgid();
>
Thanks for catching this and the suggestions!
Added the above two lines in the v4.

> because bpf_init_fs_context() is called from fsopen() which may be
> called inside a user namespace. Then you can just transfer
>
> s_fs_info->uid = opts->uid;
> s_fs_info->gid = opts->gid;
>
> and then always use:
>
> inode->i_uid = s_fs_info->uid;
> inode->i_gid = s_fs_info->gid;
>
> when initializing inodes. Otherwise looks good.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux