Re: [PATCH net-next v3 2/3] Add a eBPF helper function to retrieve socket uid

2017-02-23 Thread Willem de Bruijn
> +BPF_CALL_1(bpf_get_socket_uid, struct sk_buff *, skb) > +{ > + struct sock *sk = sk_to_full_sk(skb->sk); > + kuid_t kuid = sock_net_uid(dev_net(skb->dev), sk); dev_net cannot handle a NULL skb->dev

[PATCH net-next v3 2/3] Add a eBPF helper function to retrieve socket uid

2017-02-22 Thread Chenbo Feng
From: Chenbo Feng Returns the owner uid of the socket inside a sk_buff. This is useful to perform per-UID accounting of network traffic or per-UID packet filtering. The socket need to be a fullsock otherwise 0 is returned. Change since V2: Add a sk_to_full_sk() check before retrieving the uid. M

[PATCH net-next v3 2/3] Add a eBPF helper function to retrieve socket uid

2017-02-22 Thread Chenbo Feng
From: Chenbo Feng Returns the owner uid of the socket inside a sk_buff. This is useful to perform per-UID accounting of network traffic or per-UID packet filtering. The socket need to be a fullsock otherwise 0 is returned. Change since V2: Add a sk_to_full_sk() check before retrieving the uid. M