> +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
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
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