Stanislav Fomichev f5836749c9 bpf: Add BPF_CGROUP_INET_SOCK_RELEASE hook
Sometimes it's handy to know when the socket gets freed. In
particular, we'd like to try to use a smarter allocation of
ports for bpf_bind and explore the possibility of limiting
the number of SOCK_DGRAM sockets the process can have.

Implement BPF_CGROUP_INET_SOCK_RELEASE hook that triggers on
inet socket release. It triggers only for userspace sockets
(not in-kernel ones) and therefore has the same semantics as
the existing BPF_CGROUP_INET_SOCK_CREATE.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200706230128.4073544-2-sdf@google.com
2020-07-08 01:03:31 +02:00
..
2019-05-21 12:33:38 -07:00
2020-03-12 15:55:00 -07:00
2020-03-12 15:55:00 -07:00
2020-03-30 13:45:04 -07:00
2020-05-28 11:11:45 -07:00
2020-06-10 13:18:40 -07:00
2019-09-13 21:44:19 +02:00
2020-03-16 18:26:54 -07:00
2020-04-30 13:24:01 -07:00
2020-03-16 18:26:55 -07:00
2020-06-24 11:21:03 -07:00
2020-06-24 18:37:59 -07:00