On Mon, Nov 16, 2026 at 3:21 AM Christian Brauner <[email protected]> wrote:
>
> Initialize bpffs as a pseudo filesystem instead of raising
> SB_I_NOEXEC and SB_I_NODEV by hand. This adds SB_I_PSEUDO.
>
> Reviewed-by: Christoph Hellwig <[email protected]>
> Reviewed-by: Alexander Mikhalitsyn <[email protected]>
> Reviewed-by: Chris Down <[email protected]>
> Signed-off-by: Christian Brauner (Amutable) <[email protected]>
> ---
>  kernel/bpf/inode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Acked-by: Andrii Nakryiko <[email protected]>

> diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
> index c6f328e4752e1..57cf3775c0766 100644
> --- a/kernel/bpf/inode.c
> +++ b/kernel/bpf/inode.c
> @@ -15,6 +15,7 @@
>  #include <linux/namei.h>
>  #include <linux/fs.h>
>  #include <linux/fs_context.h>
> +#include <linux/pseudo_fs.h>
>  #include <linux/fs_parser.h>
>  #include <linux/kdev_t.h>
>  #include <linux/filter.h>
> @@ -1197,8 +1198,6 @@ static int bpf_fill_super(struct super_block *sb, 
> struct fs_context *fc)
>         sb->s_magic = BPF_FS_MAGIC;
>         sb->s_op = &bpf_super_ops;
>         sb->s_xattr = bpf_fs_xattr_handlers;
> -       sb->s_iflags |= SB_I_NOEXEC;
> -       sb->s_iflags |= SB_I_NODEV;
>         sb->s_time_gran = 1;
>
>         inode = bpf_get_inode(sb, NULL, S_IFDIR | 0777);
> @@ -1261,6 +1260,7 @@ static int bpf_init_fs_context(struct fs_context *fc)
>         opts->delegate_attachs = 0;
>
>         fc->s_fs_info = opts;
> +       fc_init_pseudo(fc);
>         fc->ops = &bpf_context_ops;
>         return 0;
>  }
>
> --
> 2.53.0
>
>

Reply via email to