Commit d2a3b7c
bpf: Fix net.core.bpf_jit_harden race
It is the bpf_jit_harden counterpart to commit 60b58af ("bpf: fix
net.core.bpf_jit_enable race"). bpf_jit_harden will be tested twice
for each subprog if there are subprogs in bpf program and constant
blinding may increase the length of program, so when running
"./test_progs -t subprogs" and toggling bpf_jit_harden between 0 and 2,
jit_subprogs may fail because constant blinding increases the length
of subprog instructions during extra passs.
So cache the value of bpf_jit_blinding_enabled() during program
allocation, and use the cached value during constant blinding, subprog
JITing and args tracking of tail call.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220309123321.2400262-4-houtao1@huawei.com1 parent 73e1445 commit d2a3b7c
3 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
1382 | 1383 | | |
1383 | 1384 | | |
1384 | 1385 | | |
1385 | | - | |
| 1386 | + | |
1386 | 1387 | | |
1387 | 1388 | | |
1388 | 1389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13023 | 13023 | | |
13024 | 13024 | | |
13025 | 13025 | | |
| 13026 | + | |
13026 | 13027 | | |
13027 | 13028 | | |
13028 | 13029 | | |
| |||
13146 | 13147 | | |
13147 | 13148 | | |
13148 | 13149 | | |
| 13150 | + | |
13149 | 13151 | | |
13150 | 13152 | | |
13151 | 13153 | | |
| |||
13239 | 13241 | | |
13240 | 13242 | | |
13241 | 13243 | | |
13242 | | - | |
13243 | 13244 | | |
13244 | 13245 | | |
13245 | 13246 | | |
| |||
13403 | 13404 | | |
13404 | 13405 | | |
13405 | 13406 | | |
13406 | | - | |
| 13407 | + | |
13407 | 13408 | | |
13408 | 13409 | | |
13409 | 13410 | | |
| |||
0 commit comments