mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Add a eBPF helper function to retrieve socket uid
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 overflowuid is returned. Signed-off-by: Chenbo Feng <fengc@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
91b8270f2a
commit
6acc5c2910
3 changed files with 32 additions and 2 deletions
|
@ -507,7 +507,8 @@ union bpf_attr {
|
|||
FN(skb_change_head), \
|
||||
FN(xdp_adjust_head), \
|
||||
FN(probe_read_str), \
|
||||
FN(get_socket_cookie),
|
||||
FN(get_socket_cookie), \
|
||||
FN(get_socket_uid),
|
||||
|
||||
/* integer value in 'imm' field of BPF_CALL instruction selects which helper
|
||||
* function eBPF program intends to call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue