Re: [PATCH bpf-next v2 1/2] bpf: Eliminate dup/restore of insn_aux_data

From: Eduard Zingerman

Date: Mon Aug 10 2026 - 17:17:18 EST


On Tue, 2026-07-28 at 20:25 +0000, Xu Kuohai wrote:
> From: Xu Kuohai <xukuohai@xxxxxxxxxx>
>
> The dup/restore of insn_aux_data was introduced to resolve the
> inconsistency between insnsi and insn_aux_data arrays, which occurs
> on the failure path where insnsi was rolled back to the original
> state before constants blinding, while insn_aux_data was not.
>
> After JIT failure, there is only one user, bpf_clear_insn_aux_data(),
> that requires insnsi and insn_aux_data to be synchronized. It accesses
> both insnsi and insn_aux_data using the same array size and index.
>
> However, the access to insnsi in bpf_clear_insn_aux_data() is not
> necessary. It is checked to skip the second slot of an ldimm64 instruction,
> whose jt is never set and can be absorbed into the jt check itself.
>
> So remove the access to insnsi from bpf_clear_insn_aux_data(), and add a
> specific length field for insn_aux_data to allow it to have a different
> length from the insnsi array. Then remove dup/restore of insn_aux_data.
>
> Signed-off-by: Xu Kuohai <xukuohai@xxxxxxxxxx>
> ---

Hi Xu, sorry for the delayed response, the patch lgtm.

Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>

...