Skip to content

Commit 35a4b8c

Browse files
hbathinimpe
authored andcommitted
powerpc/bpf: populate extable entries only during the last pass
Since commit 85e0311 ("powerpc/bpf: Perform complete extra passes to update addresses"), two additional passes are performed to avoid space and CPU time wastage on powerpc. But these extra passes led to WARN_ON_ONCE() hits in bpf_add_extable_entry() as extable entries are populated again, during the extra pass, without resetting the index. Fix it by resetting entry index before repopulating extable entries, if and when there is an additional pass. Fixes: 85e0311 ("powerpc/bpf: Perform complete extra passes to update addresses") Cc: [email protected] # v6.3+ Signed-off-by: Hari Bathini <[email protected]> Reviewed-by: Naveen N. Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 2b694fc commit 35a4b8c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/powerpc/net/bpf_jit_comp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
101101
bpf_hdr = jit_data->header;
102102
proglen = jit_data->proglen;
103103
extra_pass = true;
104+
/* During extra pass, ensure index is reset before repopulating extable entries */
105+
cgctx.exentry_idx = 0;
104106
goto skip_init_ctx;
105107
}
106108

0 commit comments

Comments
 (0)