public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox•net>
To: Lorenzo Colitti <lorenzo@google•com>
Cc: Chenbo Feng <chenbofeng.kernel@gmail•com>,
	"David S . Miller" <davem@davemloft•net>,
	Alexei Starovoitov <ast@fb•com>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	Willem de Bruijn <willemb@google•com>,
	Chenbo Feng <fengc@google•com>
Subject: Re: [PATCH net-next 2/2] Add a eBPF helper function to retrieve socket uid
Date: Fri, 03 Feb 2017 01:28:31 +0100	[thread overview]
Message-ID: <5893CEAF.2090707@iogearbox.net> (raw)
In-Reply-To: <CAKD1Yr30K4Yi8U0bnTOq60rPW6aYY1Vb4xxmRgZdz319UmLmRw@mail.gmail.com>

On 02/03/2017 01:00 AM, Lorenzo Colitti wrote:
> On Fri, Feb 3, 2017 at 6:32 AM, Daniel Borkmann <daniel@iogearbox•net> wrote:
>>> +       sk = skb->sk;
>>> +       kuid = sock_net_uid(dev_net(skb->dev), sk);
>>
>> Don't you need to test for fullsock? Do you mean something like below?
>
> It should be safe to call sock_net_uid on any type of socket
> (including NULL). sk_uid was added to struct sock in 86741ec25462
> ("net: core: Add a UID field to struct sock.")

Hmm, maybe I'm missing something, but then shouldn't this sit in
struct sock_common for being 'safe'? F.e. struct inet_timewait_sock
wouldn't have it ...

  reply	other threads:[~2017-02-03  0:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 20:59 [PATCH net-next 0/2] net: core: Two Helper function about socket information Chenbo Feng
2017-02-02 20:59 ` [PATCH net-next 1/2] Add a helper function to get socket cookie in eBPF Chenbo Feng
2017-02-02 21:23   ` Daniel Borkmann
2017-02-02 20:59 ` [PATCH net-next 2/2] Add a eBPF helper function to retrieve socket uid Chenbo Feng
2017-02-02 21:32   ` Daniel Borkmann
2017-02-03  0:00     ` Lorenzo Colitti
2017-02-03  0:28       ` Daniel Borkmann [this message]
2017-02-03  0:31       ` Eric Dumazet
2017-02-03  1:18         ` Lorenzo Colitti
2017-02-03  1:51           ` Eric Dumazet
2017-02-03  8:25             ` Daniel Borkmann
2017-02-06  3:25             ` Lorenzo Colitti
2017-02-03  0:13 ` [PATCH net-next 0/2] net: core: Two Helper function about socket information Alexei Starovoitov
2017-02-03 16:19   ` Lorenzo Colitti

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=5893CEAF.2090707@iogearbox.net \
    --to=daniel@iogearbox$(echo .)net \
    --cc=ast@fb$(echo .)com \
    --cc=chenbofeng.kernel@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=fengc@google$(echo .)com \
    --cc=lorenzo@google$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=willemb@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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