ACK: [SRU Bionic] cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
Andrea Righi
andrea.righi at canonical.com
Thu Aug 27 08:12:42 UTC 2020
On Wed, Aug 26, 2020 at 04:27:22PM -0300, Thadeu Lima de Souza Cascardo wrote:
> From: Yang Yingliang <yangyingliang at huawei.com>
>
> BugLink: https://bugs.launchpad.net/bugs/1886860
>
> Add skcd->no_refcnt check which is missed when backporting
> ad0f75e5f57c ("cgroup: fix cgroup_sk_alloc() for sk_clone_lock()").
>
> This patch is needed in stable-4.9, stable-4.14 and stable-4.19.
>
> Signed-off-by: Yang Yingliang <yangyingliang at huawei.com>
> Signed-off-by: Sasha Levin <sashal at kernel.org>
> (cherry picked from commit 1bfba2f4270c64c912756fc76621bbce959ddf2e linux-4.14.y)
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
Makes sense to me.
Acked-by: Andrea Righi <andrea.righi at canonical.com>
> ---
> kernel/cgroup/cgroup.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 963ec350d07e..37ca9b4b04b2 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -5919,6 +5919,8 @@ void cgroup_sk_clone(struct sock_cgroup_data *skcd)
> {
> /* Socket clone path */
> if (skcd->val) {
> + if (skcd->no_refcnt)
> + return;
> /*
> * We might be cloning a socket which is left in an empty
> * cgroup and the cgroup might have already been rmdir'd.
> --
> 2.25.1
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
More information about the kernel-team
mailing list