]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
mptcp: attach subflow socket to parent cgroup
authorNicolas Rybowski <nicolas.rybowski@tessares.net>
Thu, 10 Dec 2020 22:24:58 +0000 (14:24 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Dec 2020 01:30:06 +0000 (17:30 -0800)
commit3764b0c5651e34ceb3e7d5c75b6fd8e7b72112ac
treede5f7156cfb07f742ef9c7c1efe9af6ee3a88f70
parentefc36d3c344a36fe73cda93c55763058629e0f2c
mptcp: attach subflow socket to parent cgroup

It has been observed that the kernel sockets created for the subflows
(except the first one) are not in the same cgroup as their parents.
That's because the additional subflows are created by kernel workers.

This is a problem with eBPF programs attached to the parent's
cgroup won't be executed for the children. But also with any other features
of CGroup linked to a sk.

This patch fixes this behaviour.

As the subflow sockets are created by the kernel, we can't use
'mem_cgroup_sk_alloc' because of the current context being the one of the
kworker. This is why we have to do low level memcg manipulation, if
required.

Suggested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Nicolas Rybowski <nicolas.rybowski@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/subflow.c