]> Gentwo Git Trees - linux/.git/commit
bpf: add kfuncs and helpers support for file dynptrs
authorMykyta Yatsenko <yatsenko@meta.com>
Sun, 26 Oct 2025 20:38:50 +0000 (20:38 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 27 Oct 2025 16:56:27 +0000 (09:56 -0700)
commite3e36edb1b8f0e6975c68acd2e1202ec0397fd75
treebc27a92bb4d988168af7c6dc93c8580fce07b18c
parent8d8771dc03e48300e80b43744dd3c320ccaf746a
bpf: add kfuncs and helpers support for file dynptrs

Add support for file dynptr.

Introduce struct bpf_dynptr_file_impl to hold internal state for file
dynptrs, with 64-bit size and offset support.

Introduce lifecycle management kfuncs:
  - bpf_dynptr_from_file() for initialization
  - bpf_dynptr_file_discard() for destruction

Extend existing helpers to support file dynptrs in:
  - bpf_dynptr_read()
  - bpf_dynptr_slice()

Write helpers (bpf_dynptr_write() and bpf_dynptr_data()) are not
modified, as file dynptr is read-only.

Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20251026203853.135105-8-mykyta.yatsenko5@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/helpers.c