Re: [PATCH v2 bpf-next 1/5] bpf: Hooks for sys_sendmsg

2018-05-24 Thread Andrey Ignatov
Daniel Borkmann [Thu, 2018-05-24 18:00 -0700]: > On 05/23/2018 01:40 AM, Andrey Ignatov wrote: > [...] > > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c > > index ff4d4ba..a1f9ba2 100644 > > --- a/net/ipv4/udp.c > > +++ b/net/ipv4/udp.c > > @@ -900,6 +900,7 @@ int udp_sendmsg(struct sock *sk, struc

Re: [PATCH v2 bpf-next 1/5] bpf: Hooks for sys_sendmsg

2018-05-24 Thread Daniel Borkmann
On 05/23/2018 01:40 AM, Andrey Ignatov wrote: [...] > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c > index ff4d4ba..a1f9ba2 100644 > --- a/net/ipv4/udp.c > +++ b/net/ipv4/udp.c > @@ -900,6 +900,7 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, > size_t len) > { > struct inet_sock *i

Re: [PATCH v2 bpf-next 1/5] bpf: Hooks for sys_sendmsg

2018-05-23 Thread Martin KaFai Lau
On Tue, May 22, 2018 at 04:40:02PM -0700, Andrey Ignatov wrote: > In addition to already existing BPF hooks for sys_bind and sys_connect, > the patch provides new hooks for sys_sendmsg. > > It leverages existing BPF program type `BPF_PROG_TYPE_CGROUP_SOCK_ADDR` > that provides access to socket itl

[PATCH v2 bpf-next 1/5] bpf: Hooks for sys_sendmsg

2018-05-22 Thread Andrey Ignatov
In addition to already existing BPF hooks for sys_bind and sys_connect, the patch provides new hooks for sys_sendmsg. It leverages existing BPF program type `BPF_PROG_TYPE_CGROUP_SOCK_ADDR` that provides access to socket itlself (properties like family, type, protocol) and user-passed `struct sock