public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Alexei Starovoitov <ast@plumgrid.com>,
	David Miller <davem@davemloft.net>
Cc: luto@amacapital.net, mingo@kernel.org, rostedt@goodmis.org,
	wangnan0@huawei.com, lizefan@huawei.com,
	daniel.wagner@bmw-carit.de, linux-api@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking
Date: Tue, 16 Jun 2015 11:19:40 +0200	[thread overview]
Message-ID: <557FEA2C.5080408@iogearbox.net> (raw)
In-Reply-To: <557F97F3.6060400@plumgrid.com>

On 06/16/2015 05:28 AM, Alexei Starovoitov wrote:
> On 6/15/15 4:01 PM, David Miller wrote:
>>
>> Although I agree with the sentiment that this thing can cause
>> surprising results and can be asking for trouble.
>>
>> If someone wants to filter traffic "by UID" they might make
>> a simple ingress TC ebpf program using these new interfaces
>> and expect it to work.
>>
>> But the UID their program will see will be the UID of whatever
>> randomly happened to be executing when the packet was received
>> and processed.
>
> yes, you're right. Such tc filters will be incorrect.
> Will send a partial revert disallowing them in tc.

Sorry for late reply [on vacation]; if you really want to, you
could go via skb->sk->sk_socket->file and then retrieve credentials
from there for egress side (you can have a look at xt_owner). You'd
need a different *_proto helper for tc in that case, which would
then map to BPF_FUNC_get_current_uid_gid, etc. But that doesn't work
for ingress however, even if you would have early demux, so you
would need to let the eBPF helper function return an error code in
that case.

  reply	other threads:[~2015-06-16  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13  2:39 [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking Alexei Starovoitov
2015-06-13  2:39 ` [PATCH v2 net-next 1/3] bpf: introduce current->pid, tgid, uid, gid, comm accessors Alexei Starovoitov
2015-06-13  2:39 ` [PATCH v2 net-next 2/3] bpf: allow networking programs to use bpf_trace_printk() for debugging Alexei Starovoitov
2015-06-13  2:39 ` [PATCH v2 net-next 3/3] bpf: let kprobe programs use bpf_get_smp_processor_id() helper Alexei Starovoitov
2015-06-13  8:23   ` Daniel Borkmann
2015-06-15 23:01 ` [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking David Miller
2015-06-16  3:28   ` Alexei Starovoitov
2015-06-16  9:19     ` Daniel Borkmann [this message]
2015-06-16 17:10       ` Alexei Starovoitov
2015-06-18  8:10         ` Daniel Borkmann

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=557FEA2C.5080408@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@plumgrid.com \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=davem@davemloft.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=wangnan0@huawei.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