Lines Matching refs:mnt_fd
117 int mnt_fd, err; in materialize_bpffs_fd() local
139 mnt_fd = sys_fsmount(fs_fd, 0, 0); in materialize_bpffs_fd()
143 return mnt_fd; in materialize_bpffs_fd()
287 int mnt_fd = -1, fs_fd = -1, err = 0, bpffs_fd = -1, token_fd = -1; in child() local
340 err = recvfd(sock_fd, &mnt_fd); in child()
345 fs_fd = sys_fspick(mnt_fd, "", FSPICK_EMPTY_PATH); in child()
374 bpffs_fd = openat(mnt_fd, ".", 0, O_RDWR); in child()
399 zclose(mnt_fd); in child()
431 int fs_fd = -1, mnt_fd = -1, token_fd = -1, err; in parent() local
437 mnt_fd = materialize_bpffs_fd(fs_fd, bpffs_opts); in parent()
438 if (!ASSERT_GE(mnt_fd, 0, "materialize_bpffs_fd")) { in parent()
445 err = sendfd(sock_fd, mnt_fd); in parent()
448 zclose(mnt_fd); in parent()
461 zclose(mnt_fd); in parent()
498 static int userns_map_create(int mnt_fd, struct token_lsm *lsm_skel) in userns_map_create() argument
505 token_fd = bpf_token_create(mnt_fd, NULL); in userns_map_create()
566 static int userns_btf_load(int mnt_fd, struct token_lsm *lsm_skel) in userns_btf_load() argument
576 token_fd = bpf_token_create(mnt_fd, NULL); in userns_btf_load()
635 static int userns_prog_load(int mnt_fd, struct token_lsm *lsm_skel) in userns_prog_load() argument
652 token_fd = bpf_token_create(mnt_fd, NULL); in userns_prog_load()
714 static int userns_obj_priv_map(int mnt_fd, struct token_lsm *lsm_skel) in userns_obj_priv_map() argument
728 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", mnt_fd); in userns_obj_priv_map()
742 static int userns_obj_priv_prog(int mnt_fd, struct token_lsm *lsm_skel) in userns_obj_priv_prog() argument
756 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", mnt_fd); in userns_obj_priv_prog()
795 static int validate_struct_ops_load(int mnt_fd, bool expect_success) in validate_struct_ops_load() argument
802 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", mnt_fd); in validate_struct_ops_load()
821 static int userns_obj_priv_btf_fail(int mnt_fd, struct token_lsm *lsm_skel) in userns_obj_priv_btf_fail() argument
823 return validate_struct_ops_load(mnt_fd, false /* should fail */); in userns_obj_priv_btf_fail()
826 static int userns_obj_priv_btf_success(int mnt_fd, struct token_lsm *lsm_skel) in userns_obj_priv_btf_success() argument
828 return validate_struct_ops_load(mnt_fd, true /* should succeed */); in userns_obj_priv_btf_success()
834 static int userns_obj_priv_implicit_token(int mnt_fd, struct token_lsm *lsm_skel) in userns_obj_priv_implicit_token() argument
852 err = sys_move_mount(mnt_fd, "", AT_FDCWD, "/sys/fs/bpf", MOVE_MOUNT_F_EMPTY_PATH); in userns_obj_priv_implicit_token()
893 static int userns_obj_priv_implicit_token_envvar(int mnt_fd, struct token_lsm *lsm_skel) in userns_obj_priv_implicit_token_envvar() argument
915 err = sys_move_mount(mnt_fd, "", AT_FDCWD, TOKEN_BPFFS_CUSTOM, MOVE_MOUNT_F_EMPTY_PATH); in userns_obj_priv_implicit_token_envvar()