mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 13:54:57 +08:00
bpf: Allow bpf_d_path in bpf_iter program
task_file and task_vma iter programs have access to file->f_path. Enable bpf_d_path to print paths of these file. Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20210212183107.50963-3-songliubraving@fb.com
This commit is contained in:
parent
3a7b35b899
commit
3d06f34aa8
@ -1191,6 +1191,10 @@ BTF_SET_END(btf_allowlist_d_path)
|
|||||||
|
|
||||||
static bool bpf_d_path_allowed(const struct bpf_prog *prog)
|
static bool bpf_d_path_allowed(const struct bpf_prog *prog)
|
||||||
{
|
{
|
||||||
|
if (prog->type == BPF_PROG_TYPE_TRACING &&
|
||||||
|
prog->expected_attach_type == BPF_TRACE_ITER)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (prog->type == BPF_PROG_TYPE_LSM)
|
if (prog->type == BPF_PROG_TYPE_LSM)
|
||||||
return bpf_lsm_is_sleepable_hook(prog->aux->attach_btf_id);
|
return bpf_lsm_is_sleepable_hook(prog->aux->attach_btf_id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user