Commit c0576e3
net: call cgroup_sk_alloc() earlier in sk_clone_lock()
If for some reason, the newly allocated child need to be freed,
we will call cgroup_put() (via sk_free_unlock_clone()) while the
corresponding cgroup_get() was not yet done, and we will free memory
too soon.
Fixes: d979a39 ("cgroup: duplicate cgroup reference when cloning sockets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 75cb070 commit c0576e3
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
| 1690 | + | |
1690 | 1691 | | |
1691 | 1692 | | |
1692 | 1693 | | |
| |||
1718 | 1719 | | |
1719 | 1720 | | |
1720 | 1721 | | |
1721 | | - | |
1722 | | - | |
1723 | 1722 | | |
1724 | 1723 | | |
1725 | 1724 | | |
| |||
0 commit comments