On 05/17/2018 11:57 AM, Martin KaFai Lau wrote: > On Thu, May 17, 2018 at 08:54:10AM -0700, John Fastabend wrote: >> Add tests for BPF_PROG_TYPE_SK_MSG to test_verifier for read access >> to new sk fields. >> >> Signed-off-by: John Fastabend <john.fastab...@gmail.com> >> ---
[...] >> + { >> + "invalid read past end of SK_MSG", >> + .insns = { >> + BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1, >> + offsetof(struct sk_msg_md, local_port) + 4), >> + BPF_EXIT_INSN(), >> + }, >> + .errstr = "", > no errstr in this case? > >> + .result = REJECT, >> + .prog_type = BPF_PROG_TYPE_SK_MSG, >> + }, >> + { >> + "invalid read offset in SK_MSG", >> + .insns = { >> + BPF_LDX_MEM(BPF_W, BPF_REG_2, BPF_REG_1, >> + offsetof(struct sk_msg_md, family) + 1), >> + BPF_EXIT_INSN(), >> + }, >> + .errstr = "", > same here. > >> + .result = REJECT, >> + .prog_type = BPF_PROG_TYPE_SK_MSG, >> + }, >> + { >> "direct packet read for SK_MSG", >> .insns = { >> BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, >> > Other than the above, > For completeness I guess we should have the err string included. I'll send a v2 and push ACKs forward. > Acked-by: Martin KaFai Lau <ka...@fb.com> >