From: John Fastabend <john.fastabend@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org
Subject: Re: [bpf-next PATCH 2/2] bpf: add sk_msg prog sk access tests to test_verifier
Date: Thu, 17 May 2018 13:12:52 -0700 [thread overview]
Message-ID: <245d2776-ff4c-0c55-6eb9-cde7452efc78@gmail.com> (raw)
In-Reply-To: <20180517185703.4zdqjyynrc5gkt5q@kafai-mbp.dhcp.thefacebook.com>
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.fastabend@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 <kafai@fb.com>
>
prev parent reply other threads:[~2018-05-17 20:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 15:53 [bpf-next PATCH 0/2] SK_MSG programs: read sock fields John Fastabend
2018-05-17 15:54 ` [bpf-next PATCH 1/2] bpf: allow sk_msg programs to " John Fastabend
2018-05-17 18:17 ` Martin KaFai Lau
2018-05-17 20:16 ` John Fastabend
2018-05-17 15:54 ` [bpf-next PATCH 2/2] bpf: add sk_msg prog sk access tests to test_verifier John Fastabend
2018-05-17 18:57 ` Martin KaFai Lau
2018-05-17 20:12 ` John Fastabend [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=245d2776-ff4c-0c55-6eb9-cde7452efc78@gmail.com \
--to=john.fastabend@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).