Revert "bpf: check changes_pkt_data property for extension programs"
This reverts commit 3846e2bea5 which is
commit 81f6d0530ba031b5f038a091619bf2ff29568852 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: Iad790b1cf2b6235887063f8cd4f531a0eea52e9c
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -1510,7 +1510,6 @@ struct bpf_prog_aux {
|
||||
bool exception_cb;
|
||||
bool exception_boundary;
|
||||
bool is_extended; /* true if extended by freplace program */
|
||||
bool changes_pkt_data;
|
||||
u64 prog_array_member_cnt; /* counts how many times as member of prog_array */
|
||||
struct mutex ext_mutex; /* mutex for is_extended and prog_array_member_cnt */
|
||||
struct bpf_arena *arena;
|
||||
|
||||
@@ -16650,7 +16650,6 @@ walk_cfg:
|
||||
}
|
||||
}
|
||||
ret = 0; /* cfg looks good */
|
||||
env->prog->aux->changes_pkt_data = env->subprog_info[0].changes_pkt_data;
|
||||
|
||||
err_free:
|
||||
kvfree(insn_state);
|
||||
@@ -20153,7 +20152,6 @@ static int jit_subprogs(struct bpf_verifier_env *env)
|
||||
func[i]->aux->num_exentries = num_exentries;
|
||||
func[i]->aux->tail_call_reachable = env->subprog_info[i].tail_call_reachable;
|
||||
func[i]->aux->exception_cb = env->subprog_info[i].is_exception_cb;
|
||||
func[i]->aux->changes_pkt_data = env->subprog_info[i].changes_pkt_data;
|
||||
if (!i)
|
||||
func[i]->aux->exception_boundary = env->seen_exception;
|
||||
func[i] = bpf_int_jit_compile(func[i]);
|
||||
@@ -22024,12 +22022,6 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,
|
||||
"Extension programs should be JITed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (prog->aux->changes_pkt_data &&
|
||||
!aux->func[subprog]->aux->changes_pkt_data) {
|
||||
bpf_log(log,
|
||||
"Extension program changes packet data, while original does not\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
if (!tgt_prog->jited) {
|
||||
bpf_log(log, "Can attach to only JITed progs\n");
|
||||
@@ -22495,6 +22487,10 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr, __u3
|
||||
if (ret < 0)
|
||||
goto skip_full_check;
|
||||
|
||||
ret = check_attach_btf_id(env);
|
||||
if (ret)
|
||||
goto skip_full_check;
|
||||
|
||||
ret = resolve_pseudo_ldimm64(env);
|
||||
if (ret < 0)
|
||||
goto skip_full_check;
|
||||
@@ -22509,10 +22505,6 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr, __u3
|
||||
if (ret < 0)
|
||||
goto skip_full_check;
|
||||
|
||||
ret = check_attach_btf_id(env);
|
||||
if (ret)
|
||||
goto skip_full_check;
|
||||
|
||||
ret = mark_fastcall_patterns(env);
|
||||
if (ret < 0)
|
||||
goto skip_full_check;
|
||||
|
||||
Reference in New Issue
Block a user