Files
kernel/include/linux
Bui Quang Minh afe041c2d0 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/20211113154412.91134-1-minhquangbui99@gmail.com
Fixes: 550a7d60bd ("mm, hugepages: add mremap() support for hugepage backed vma")
Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-20 10:35:54 -08:00
..
2021-10-07 16:51:57 +02:00
2021-10-18 14:43:23 -06:00
2021-10-25 12:01:14 +05:30
2021-10-18 07:49:38 -04:00
2021-10-05 06:54:16 -05:00
2021-10-18 07:49:39 -04:00
2021-11-06 14:08:17 -07:00
2021-11-10 21:16:56 +00:00
2021-10-18 07:49:39 -04:00
2021-10-14 13:29:18 +02:00
2021-10-07 16:51:57 +02:00
2021-10-18 07:49:39 -04:00
2021-10-18 17:20:50 +02:00
2021-10-30 16:37:28 +02:00
2021-11-06 13:30:43 -07:00
2021-10-26 14:58:45 +01:00
2021-11-03 11:41:25 -07:00
2021-10-07 13:51:11 +02:00
2021-10-19 23:44:30 +08:00