diff options
author | Dmitry Yakunin <zeil@yandex-team.ru> | 2020-04-30 18:51:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-30 22:54:01 +0300 |
commit | 6e3a401fc8af01828bcdc92d713195d318b36e7e (patch) | |
tree | 6b3c057c6caecbb64eee8852ff65a4689d612ad1 /include/uapi/linux/inet_diag.h | |
parent | 8a769c65bb7a3cba0db01b0f46850862c9f5d7bf (diff) | |
download | linux-6e3a401fc8af01828bcdc92d713195d318b36e7e.tar.xz |
inet_diag: add cgroup id attribute
This patch adds cgroup v2 ID to common inet diag message attributes.
Cgroup v2 ID is kernfs ID (ino or ino+gen). This attribute allows filter
inet diag output by cgroup ID obtained by name_to_handle_at() syscall.
When net_cls or net_prio cgroup is activated this ID is equal to 1 (root
cgroup ID) for newly created sockets.
Some notes about this ID:
1) gets initialized in socket() syscall
2) incoming socket gets ID from listening socket
(not during accept() syscall)
3) not changed when process get moved to another cgroup
4) can point to deleted cgroup (refcounting)
v2:
- use CONFIG_SOCK_CGROUP_DATA instead if CONFIG_CGROUPS
v3:
- fix attr size by using nla_total_size_64bit() (Eric Dumazet)
- more detailed commit message (Konstantin Khlebnikov)
Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru>
Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-By: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/inet_diag.h')
-rw-r--r-- | include/uapi/linux/inet_diag.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h index 57cc429a9177..c9b1e551792c 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h @@ -157,6 +157,7 @@ enum { INET_DIAG_MD5SIG, INET_DIAG_ULP_INFO, INET_DIAG_SK_BPF_STORAGES, + INET_DIAG_CGROUP_ID, __INET_DIAG_MAX, }; |