mbox series

[bpf-next,v4,0/2] bpf: expand bpf_d_path helper allowlist

Message ID 20210726141013.2239765-1-hengqi.chen@gmail.com (mailing list archive)
Headers show
Series bpf: expand bpf_d_path helper allowlist | expand

Message

Hengqi Chen July 26, 2021, 2:10 p.m. UTC
This patch set adds more functions to bpf_d_path allowlist.

Patch 1 is prep work which updates resolve_btfids to emit warnings
on missing symbols instead of aborting kernel build process.

Patch 2 expands bpf_d_path allowlist.

Changes since v3: [3]
 - Addressed Yonghong's comments. Sort allowlist and add security_bprm_*

Changes since v2: [2]
 - Andrii suggested that we should first address an issue of .BTF_ids
   before adding more symbols to .BTF_ids. Fixed that.
 - Yaniv proposed adding security_sb_mount and security_bprm_check.
   Added them.

Changes since v1: [1]
 - Alexei and Yonghong suggested that bpf_d_path helper could also
   apply to vfs_* and security_file_* kernel functions. Added them.

[1] https://lore.kernel.org/bpf/20210712162424.2034006-1-hengqi.chen@gmail.com/
[2] https://lore.kernel.org/bpf/20210719151753.399227-1-hengqi.chen@gmail.com/
[3] https://lore.kernel.org/bpf/20210725141814.2000828-3-hengqi.chen@gmail.com/

Hengqi Chen (2):
  tools/resolve_btfids: emit warnings and patch zero id for missing
    symbols
  bpf: expose bpf_d_path helper to vfs_* and security_* functions

 kernel/trace/bpf_trace.c        | 60 ++++++++++++++++++++++++++++++---
 tools/bpf/resolve_btfids/main.c | 13 +++----
 2 files changed, 63 insertions(+), 10 deletions(-)

Comments

Andrii Nakryiko July 29, 2021, 9:44 p.m. UTC | #1
On Mon, Jul 26, 2021 at 7:10 AM Hengqi Chen <hengqi.chen@gmail.com> wrote:
>
> This patch set adds more functions to bpf_d_path allowlist.
>
> Patch 1 is prep work which updates resolve_btfids to emit warnings
> on missing symbols instead of aborting kernel build process.
>
> Patch 2 expands bpf_d_path allowlist.
>
> Changes since v3: [3]
>  - Addressed Yonghong's comments. Sort allowlist and add security_bprm_*
>
> Changes since v2: [2]
>  - Andrii suggested that we should first address an issue of .BTF_ids
>    before adding more symbols to .BTF_ids. Fixed that.
>  - Yaniv proposed adding security_sb_mount and security_bprm_check.
>    Added them.
>
> Changes since v1: [1]
>  - Alexei and Yonghong suggested that bpf_d_path helper could also
>    apply to vfs_* and security_file_* kernel functions. Added them.
>
> [1] https://lore.kernel.org/bpf/20210712162424.2034006-1-hengqi.chen@gmail.com/
> [2] https://lore.kernel.org/bpf/20210719151753.399227-1-hengqi.chen@gmail.com/
> [3] https://lore.kernel.org/bpf/20210725141814.2000828-3-hengqi.chen@gmail.com/
>

I've applied the first patch to bpf-next. I'd like some more eyes on
patch #2, so I'm leaving it up for review by others for a bit longer.

> Hengqi Chen (2):
>   tools/resolve_btfids: emit warnings and patch zero id for missing
>     symbols
>   bpf: expose bpf_d_path helper to vfs_* and security_* functions
>
>  kernel/trace/bpf_trace.c        | 60 ++++++++++++++++++++++++++++++---
>  tools/bpf/resolve_btfids/main.c | 13 +++----
>  2 files changed, 63 insertions(+), 10 deletions(-)
>
> --
> 2.25.1
>