]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Document BPF_F_QUERY_EFFECTIVE flag
authorAndrey Ignatov <rdna@fb.com>
Wed, 8 Jan 2020 01:40:06 +0000 (17:40 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 9 Jan 2020 17:40:06 +0000 (09:40 -0800)
commit66023068783b648500f004592d608f5803a0a26e
treead65489a49e1c9a2b54411bff64256c5d6a30159
parentd6c56cee60d5fc000d9dfd38fbce57ccf6333486
bpf: Document BPF_F_QUERY_EFFECTIVE flag

Document BPF_F_QUERY_EFFECTIVE flag, mostly to clarify how it affects
attach_flags what may not be obvious and what may lead to confision.

Specifically attach_flags is returned only for target_fd but if programs
are inherited from an ancestor cgroup then returned attach_flags for
current cgroup may be confusing. For example, two effective programs of
same attach_type can be returned but w/o BPF_F_ALLOW_MULTI in
attach_flags.

Simple repro:
  # bpftool c s /sys/fs/cgroup/path/to/task
  ID       AttachType      AttachFlags     Name
  # bpftool c s /sys/fs/cgroup/path/to/task effective
  ID       AttachType      AttachFlags     Name
  95043    ingress                         tw_ipt_ingress
  95048    ingress                         tw_ingress

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200108014006.938363-1-rdna@fb.com
include/uapi/linux/bpf.h
tools/include/uapi/linux/bpf.h