|
@@ -3777,25 +3777,6 @@ static bool tc_cls_act_is_valid_access(int off, int size,
|
|
return bpf_skb_is_valid_access(off, size, type, info);
|
|
return bpf_skb_is_valid_access(off, size, type, info);
|
|
}
|
|
}
|
|
|
|
|
|
-static bool
|
|
|
|
-tc_cls_act_is_valid_access_analyzer(int off, int size,
|
|
|
|
- enum bpf_access_type type,
|
|
|
|
- struct bpf_insn_access_aux *info)
|
|
|
|
-{
|
|
|
|
- switch (off) {
|
|
|
|
- case offsetof(struct sk_buff, len):
|
|
|
|
- return true;
|
|
|
|
- case offsetof(struct sk_buff, data):
|
|
|
|
- info->reg_type = PTR_TO_PACKET;
|
|
|
|
- return true;
|
|
|
|
- case offsetof(struct sk_buff, cb) +
|
|
|
|
- offsetof(struct bpf_skb_data_end, data_end):
|
|
|
|
- info->reg_type = PTR_TO_PACKET_END;
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static bool __is_valid_xdp_access(int off, int size)
|
|
static bool __is_valid_xdp_access(int off, int size)
|
|
{
|
|
{
|
|
if (off < 0 || off >= sizeof(struct xdp_md))
|
|
if (off < 0 || off >= sizeof(struct xdp_md))
|
|
@@ -3830,21 +3811,6 @@ static bool xdp_is_valid_access(int off, int size,
|
|
return __is_valid_xdp_access(off, size);
|
|
return __is_valid_xdp_access(off, size);
|
|
}
|
|
}
|
|
|
|
|
|
-static bool xdp_is_valid_access_analyzer(int off, int size,
|
|
|
|
- enum bpf_access_type type,
|
|
|
|
- struct bpf_insn_access_aux *info)
|
|
|
|
-{
|
|
|
|
- switch (off) {
|
|
|
|
- case offsetof(struct xdp_buff, data):
|
|
|
|
- info->reg_type = PTR_TO_PACKET;
|
|
|
|
- return true;
|
|
|
|
- case offsetof(struct xdp_buff, data_end):
|
|
|
|
- info->reg_type = PTR_TO_PACKET_END;
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void bpf_warn_invalid_xdp_action(u32 act)
|
|
void bpf_warn_invalid_xdp_action(u32 act)
|
|
{
|
|
{
|
|
const u32 act_max = XDP_REDIRECT;
|
|
const u32 act_max = XDP_REDIRECT;
|
|
@@ -4516,10 +4482,6 @@ const struct bpf_verifier_ops tc_cls_act_verifier_ops = {
|
|
.gen_prologue = tc_cls_act_prologue,
|
|
.gen_prologue = tc_cls_act_prologue,
|
|
};
|
|
};
|
|
|
|
|
|
-const struct bpf_verifier_ops tc_cls_act_analyzer_ops = {
|
|
|
|
- .is_valid_access = tc_cls_act_is_valid_access_analyzer,
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
const struct bpf_prog_ops tc_cls_act_prog_ops = {
|
|
const struct bpf_prog_ops tc_cls_act_prog_ops = {
|
|
.test_run = bpf_prog_test_run_skb,
|
|
.test_run = bpf_prog_test_run_skb,
|
|
};
|
|
};
|
|
@@ -4530,10 +4492,6 @@ const struct bpf_verifier_ops xdp_verifier_ops = {
|
|
.convert_ctx_access = xdp_convert_ctx_access,
|
|
.convert_ctx_access = xdp_convert_ctx_access,
|
|
};
|
|
};
|
|
|
|
|
|
-const struct bpf_verifier_ops xdp_analyzer_ops = {
|
|
|
|
- .is_valid_access = xdp_is_valid_access_analyzer,
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
const struct bpf_prog_ops xdp_prog_ops = {
|
|
const struct bpf_prog_ops xdp_prog_ops = {
|
|
.test_run = bpf_prog_test_run_xdp,
|
|
.test_run = bpf_prog_test_run_xdp,
|
|
};
|
|
};
|