From: Alexei Starovoitov <ast@fb.com>
To: Daniel Borkmann <daniel@iogearbox.net>,
Song Liu <songliubraving@fb.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "ast@kernel.org" <ast@kernel.org>, Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH v4 bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB
Date: Fri, 19 Oct 2018 02:03:25 +0000 [thread overview]
Message-ID: <3f3dff79-2736-6f14-bae0-aa301d27c480@fb.com> (raw)
In-Reply-To: <13f972be-ab41-8519-24cc-4e891579dc08@fb.com>
On 10/18/18 6:33 PM, Alexei Starovoitov wrote:
> On 10/18/18 5:14 PM, Daniel Borkmann wrote:
>>> + case bpf_ctx_range(struct __sk_buff, data_meta):
>>> + case bpf_ctx_range(struct __sk_buff, flow_keys):
>>> + return false;
>> ... if it's disallowed anyway (disallowing it is the right thing to do,
>> but no need to save/restore then..)?
>>
>
> that's a good point.
> why shouldn't we allow cg_skb to access data_meta?
> xdp can set it and cgroup_skb_ingress will consume it here.
I'll take it back.
When xdp doesn't set meta_data it will be zero and
bpf_compute_data_pointers() will point data_meta to skb->data.
On ingress that's eth header, but for tx it will point
to reserved space for future eth header.
So we cannot do that.
Let's keep it disabled and adjust
bpf_compute_and_save_data_pointers() to save only 'data' pointer.
next prev parent reply other threads:[~2018-10-19 10:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 16:06 [PATCH v4 bpf-next 0/2] bpf: add cg_skb_is_valid_access Song Liu
2018-10-18 16:06 ` [PATCH v4 bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB Song Liu
2018-10-19 0:14 ` Daniel Borkmann
2018-10-19 1:33 ` Alexei Starovoitov
2018-10-19 2:03 ` Alexei Starovoitov [this message]
2018-10-18 16:06 ` [PATCH v4 bpf-next 2/2] bpf: add tests for direct packet access from CGROUP_SKB Song Liu
2018-10-18 23:34 ` [PATCH v4 bpf-next 0/2] bpf: add cg_skb_is_valid_access Alexei Starovoitov
2018-10-19 1:46 ` Alexei Starovoitov
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=3f3dff79-2736-6f14-bae0-aa301d27c480@fb.com \
--to=ast@fb.com \
--cc=Kernel-team@fb.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
/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