Lines Matching +full:get +full:- +full:only
1 // SPDX-License-Identifier: GPL-2.0
19 * bpf_get_task_exe_file - get a reference on the exe_file struct file member of
22 * @task: task_struct of which the nested mm_struct exe_file member to get a
25 * Get a reference on the exe_file struct file member field of the mm_struct
32 * This BPF kfunc may only be called from BPF LSM programs.
48 * bpf_put_file - put a reference on the supplied file
51 * Put a reference on the supplied *file*. Only referenced file pointers may be
56 * This BPF kfunc may only be called from BPF LSM programs.
64 * bpf_path_d_path - resolve the pathname for the supplied path
76 * This BPF kfunc may only be called from BPF LSM programs.
88 return -EINVAL; in bpf_path_d_path()
94 len = buf + buf__sz - ret; in bpf_path_d_path()
107 return -EINVAL; in bpf_xattr_read_permission()
112 return -EPERM; in bpf_xattr_read_permission()
118 * bpf_get_dentry_xattr - get xattr of a dentry
119 * @dentry: dentry to get xattr from
123 * Get xattr *name__str* of *dentry* and store the output in *value_ptr*.
125 * For security reasons, only *name__str* with prefixes "user." or
142 return -EINVAL; in bpf_get_dentry_xattr()
151 * bpf_get_file_xattr - get xattr of a file
152 * @file: file to get xattr from
156 * Get xattr *name__str* of *file* and store the output in *value_ptr*.
158 * For security reasons, only *name__str* with prefixes "user." or
177 return -EINVAL; in bpf_xattr_write_permission()
179 /* Only allow setting and removing security.bpf. xattrs */ in bpf_xattr_write_permission()
181 return -EPERM; in bpf_xattr_write_permission()
187 * bpf_set_dentry_xattr_locked - set a xattr of a dentry
188 * @dentry: dentry to get xattr from
195 * For security reasons, only *name__str* with prefix "security.bpf."
198 * The caller already locked dentry->d_inode.
215 return -EINVAL; in bpf_set_dentry_xattr_locked()
237 * bpf_remove_dentry_xattr_locked - remove a xattr of a dentry
238 * @dentry: dentry to get xattr from
243 * For security reasons, only *name__str* with prefix "security.bpf."
246 * The caller already locked dentry->d_inode.
274 * bpf_set_dentry_xattr - set a xattr of a dentry
275 * @dentry: dentry to get xattr from
282 * For security reasons, only *name__str* with prefix "security.bpf."
285 * The caller has not locked dentry->d_inode.
302 * bpf_remove_dentry_xattr - remove a xattr of a dentry
303 * @dentry: dentry to get xattr from
308 * For security reasons, only *name__str* with prefix "security.bpf."
311 * The caller has not locked dentry->d_inode.
328 * bpf_cgroup_read_xattr - read xattr of a cgroup's node in cgroupfs
329 * @cgroup: cgroup to get xattr from
333 * Get xattr *name__str* of *cgroup* and store the output in *value_ptr*.
335 * For security reasons, only *name__str* with prefix "user." is allowed.
346 /* Only allow reading "user.*" xattrs */ in bpf_cgroup_read_xattr()
348 return -EPERM; in bpf_cgroup_read_xattr()
353 return -EINVAL; in bpf_cgroup_read_xattr()
355 return kernfs_xattr_get(cgroup->kn, name__str, value, value_len); in bpf_cgroup_read_xattr()
375 prog->type == BPF_PROG_TYPE_LSM) in BTF_ID_FLAGS()
377 return -EACCES; in BTF_ID_FLAGS()
381 * KF_SLEEPABLE, so they are only available to sleepable hooks with
384 * Setting and removing xattr requires exclusive lock on dentry->d_inode.
408 return btf_id_set_contains(&d_inode_locked_hooks, prog->aux->attach_btf_id); in BTF_ID()