[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 6fad274f06f038c29660aa53fbad14241c9fd976
WARNING: Author mismatch between patch and upstream commit: Backport author: hsimeliere.opensource@witekio.com Commit author: Daniel Borkmanndaniel@iogearbox.net
Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: 8a33a047bd31) 6.1.y | Not found
Note: The patch differs from the upstream commit: --- 1: 6fad274f06f0 ! 1: c54a19e115f6 bpf: Add MEM_WRITE attribute @@ Metadata ## Commit message ## bpf: Add MEM_WRITE attribute
+ [ Upstream commit 6fad274f06f038c29660aa53fbad14241c9fd976 ] + Add a MEM_WRITE attribute for BPF helper functions which can be used in bpf_func_proto to annotate an argument type in order to let the verifier know that the helper writes into the memory passed as an argument. In @@ Commit message Acked-by: Kumar Kartikeya Dwivedi memxor@gmail.com Link: https://lore.kernel.org/r/20241021152809.33343-1-daniel@iogearbox.net Signed-off-by: Alexei Starovoitov ast@kernel.org + Signed-off-by: BRUNO VERNAY bruno.vernay@se.com + Signed-off-by: Hugo SIMELIERE hsimeliere.opensource@witekio.com
## include/linux/bpf.h ## @@ include/linux/bpf.h: enum bpf_type_flag { @@ include/linux/bpf.h: enum bpf_type_flag { __BPF_TYPE_LAST_FLAG = __BPF_TYPE_FLAG_MAX - 1, }; @@ include/linux/bpf.h: enum bpf_arg_type { - ARG_PTR_TO_SOCKET_OR_NULL = PTR_MAYBE_NULL | ARG_PTR_TO_SOCKET, + ARG_PTR_TO_ALLOC_MEM_OR_NULL = PTR_MAYBE_NULL | ARG_PTR_TO_ALLOC_MEM, ARG_PTR_TO_STACK_OR_NULL = PTR_MAYBE_NULL | ARG_PTR_TO_STACK, ARG_PTR_TO_BTF_ID_OR_NULL = PTR_MAYBE_NULL | ARG_PTR_TO_BTF_ID, - /* pointer to memory does not need to be initialized, helper function must fill @@ kernel/bpf/helpers.c: static const struct bpf_func_proto bpf_dynptr_from_mem_pro + .arg4_type = ARG_PTR_TO_DYNPTR | DYNPTR_TYPE_LOCAL | MEM_UNINIT | MEM_WRITE, };
- BPF_CALL_5(bpf_dynptr_read, void *, dst, u32, len, const struct bpf_dynptr_kern *, src, + BPF_CALL_5(bpf_dynptr_read, void *, dst, u32, len, struct bpf_dynptr_kern *, src,
## kernel/bpf/ringbuf.c ## @@ kernel/bpf/ringbuf.c: const struct bpf_func_proto bpf_ringbuf_reserve_dynptr_proto = { ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |