linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable-4.19] cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
@ 2020-08-13 20:33 Yang Yingliang
  2020-08-14 16:41 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2020-08-13 20:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: gregkh, tj, lizefan, xiyou.wangcong

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@huawei.com>
---
 kernel/cgroup/cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 6ae98c714edd..2a879d34bbe5 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5957,6 +5957,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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH stable-4.19] cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone()
  2020-08-13 20:33 [PATCH stable-4.19] cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone() Yang Yingliang
@ 2020-08-14 16:41 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-08-14 16:41 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, stable, gregkh, tj, lizefan, xiyou.wangcong

On Thu, Aug 13, 2020 at 08:33:42PM +0000, Yang Yingliang wrote:
>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@huawei.com>

I've queued up this and the 4.14 & 4.9 backports, thanks!

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-14 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 20:33 [PATCH stable-4.19] cgroup: add missing skcd->no_refcnt check in cgroup_sk_clone() Yang Yingliang
2020-08-14 16:41 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).