diff options
author | Hou Tao <houtao1@huawei.com> | 2022-03-09 15:33:20 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-03-17 01:13:36 +0300 |
commit | d2a3b7c5becc3992f8e7d2b9bf5eacceeedb9a48 (patch) | |
tree | c70bd9195500322ed9bbf0e4b783e9038dc3ffee /include/linux/filter.h | |
parent | 73e14451f39e54f83ea3badb6d6b8a423f901845 (diff) |
bpf: Fix net.core.bpf_jit_harden race
It is the bpf_jit_harden counterpart to commit 60b58afc96c9 ("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.com
Diffstat (limited to 'include/linux/filter.h')
-rw-r--r-- | include/linux/filter.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 05ed9bd31b45..ed0c0ff42ad5 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -566,6 +566,7 @@ struct bpf_prog { gpl_compatible:1, /* Is filter GPL compatible? */ cb_access:1, /* Is control block accessed? */ dst_needed:1, /* Do we need dst entry? */ + blinding_requested:1, /* needs constant blinding */ blinded:1, /* Was blinded */ is_func:1, /* program is a bpf function */ kprobe_override:1, /* Do we override a kprobe? */ |