Commit 0f350231 authored by Song Liu's avatar Song Liu Committed by Alexei Starovoitov

bpf: Fix leftover header->pages in sparc and powerpc code.

Replace header->pages * PAGE_SIZE with new header->size.

Fixes: ed2d9e1a ("bpf: Use size instead of pages in bpf_binary_header")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220208220509.4180389-2-song@kernel.org
parent 4172843e
...@@ -247,7 +247,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) ...@@ -247,7 +247,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
fp->jited = 1; fp->jited = 1;
fp->jited_len = proglen + FUNCTION_DESCR_SIZE; fp->jited_len = proglen + FUNCTION_DESCR_SIZE;
bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + (bpf_hdr->pages * PAGE_SIZE)); bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + bpf_hdr->size);
if (!fp->is_func || extra_pass) { if (!fp->is_func || extra_pass) {
bpf_jit_binary_lock_ro(bpf_hdr); bpf_jit_binary_lock_ro(bpf_hdr);
bpf_prog_fill_jited_linfo(fp, addrs); bpf_prog_fill_jited_linfo(fp, addrs);
......
...@@ -1599,7 +1599,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) ...@@ -1599,7 +1599,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
if (bpf_jit_enable > 1) if (bpf_jit_enable > 1)
bpf_jit_dump(prog->len, image_size, pass, ctx.image); bpf_jit_dump(prog->len, image_size, pass, ctx.image);
bpf_flush_icache(header, (u8 *)header + (header->pages * PAGE_SIZE)); bpf_flush_icache(header, (u8 *)header + header->size);
if (!prog->is_func || extra_pass) { if (!prog->is_func || extra_pass) {
bpf_jit_binary_lock_ro(header); bpf_jit_binary_lock_ro(header);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment