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

From
Eric Dumazet <hidden>
Date
2017-02-03 00:31:03
Reply to
Lorenzo Colitti, 2017-02-03
On Fri, 2017-02-03 at 09:00 +0900, Lorenzo Colitti wrote:
On Fri, Feb 3, 2017 at 6:32 AM, Daniel Borkmann [off-list ref] wrote:
quoted
quoted
+       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.")
But a request socket or a timewait socket do not have this field.

Daniel point is valid.
Thread (14 messages) 14 messages, 5 authors, last reply 2017-02-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help