Re: [PATCH bpf v5 1/2] bpf: Fix OOB in pcpu_init_value

From: Alexei Starovoitov

Date: Thu Apr 02 2026 - 22:46:31 EST


On Thu, Apr 2, 2026 at 7:41 PM Martin KaFai Lau <martin.lau@xxxxxxxxx> wrote:
>
> > > hmm... would it break the existing bpf programs? For example, my earlier
> > > data/data_end example will be rejected now because the verifier is
> > > expecting 8 bytes instead of 4 bytes from src.
> >
> > Yes, but that is a broken bpf prog that accesses out of bounds.
> > It just happens to "work" today.
>
> It is a bold move. Sure, if the percpu's map->value_size has
> the round_up(8), it should do.

I don't insist :) Just wanted to explore the options.
The current patch is fine.