diff options
| author | Bui Quang Minh <[email protected]> | 2021-11-20 00:43:40 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2021-11-20 18:35:54 +0000 |
| commit | afe041c2d0febd83698b8b0164e6b3b1dfae0b66 (patch) | |
| tree | 9f594be76a840658faf441faa4bb8cdeb48211b7 /net/unix/af_unix.c | |
| parent | mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag (diff) | |
| download | kernel-afe041c2d0febd83698b8b0164e6b3b1dfae0b66.tar.gz kernel-afe041c2d0febd83698b8b0164e6b3b1dfae0b66.zip | |
hugetlb: fix hugetlb cgroup refcounting during mremap
When hugetlb_vm_op_open() is called during copy_vma(), we may take the
reference to resv_map->css. Later, when clearing the reservation
pointer of old_vma after transferring it to new_vma, we forget to drop
the reference to resv_map->css. This leads to a reference leak of css.
Fixes this by adding a check to drop reservation css reference in
clear_vma_resv_huge_pages()
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 550a7d60bd5e35 ("mm, hugepages: add mremap() support for hugepage backed vma")
Signed-off-by: Bui Quang Minh <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Reviewed-by: Mina Almasry <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Muchun Song <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
