Re: [PATCH bpf RESEND v2 1/2] bpf: Fix memory access flags in helper prototypes

From: Eduard Zingerman

Date: Tue Jan 20 2026 - 12:55:04 EST


On Tue, 2026-01-20 at 11:39 +0800, Zesen Liu wrote:
> [...]
>
> > On Jan 20, 2026, at 04:24, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote:
> >
> > Q: why ARG_PTR_TO_UNINIT_MEM here, but not for a previous function and
> > not for snprintf variants?
>
> For bpf_get_stack_proto_raw_tp, I chose ARG_PTR_TO_UNINIT_MEM to be consistent with its siblings:
>
> • bpf_get_stack_proto_tp (bpf_trace.c:1425)
> • bpf_get_stack_proto (stackmap.c:525)
> • bpf_get_stack_sleepable_proto (stackmap.c:541)
>
> All of these are wrappers around the same core function bpf_get_stack() / __bpf_get_stack(), passing the buffer with identical semantics, and all use ARG_PTR_TO_UNINIT_MEM.

Ack, makes sense, thank you for explaining.