Commit a54b2f6
bpf, x86: set header->size properly before freeing it
On do_jit failure path, the header is freed by bpf_jit_binary_pack_free.
While bpf_jit_binary_pack_free doesn't require proper ro_header->size,
bpf_prog_pack_free still uses it. Set header->size in bpf_int_jit_compile
before calling bpf_jit_binary_pack_free.
Fixes: 1022a54 ("bpf, x86_64: Use bpf_jit_binary_pack_alloc")
Fixes: 33c9805 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]")
Reported-by: Kui-Feng Lee <kuifeng@fb.com>
Signed-off-by: Song Liu <song@kernel.org>1 parent 131e52d commit a54b2f6
2 files changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2330 | 2330 | | |
2331 | 2331 | | |
2332 | 2332 | | |
2333 | | - | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
2334 | 2337 | | |
| 2338 | + | |
2335 | 2339 | | |
2336 | 2340 | | |
2337 | 2341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
1115 | | - | |
1116 | | - | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1117 | 1118 | | |
1118 | 1119 | | |
1119 | 1120 | | |
1120 | 1121 | | |
1121 | | - | |
| 1122 | + | |
1122 | 1123 | | |
1123 | 1124 | | |
1124 | 1125 | | |
| |||
0 commit comments