]> Git Repo - linux.git/commit
userfaultfd: hugetlbfs: fix new flag usage in error path
authorMike Kravetz <[email protected]>
Sun, 23 May 2021 00:42:11 +0000 (17:42 -0700)
committerLinus Torvalds <[email protected]>
Sun, 23 May 2021 01:09:07 +0000 (15:09 -1000)
commite32905e57358fdfb82f9de024534f205b3af7dac
tree8fd4c5a222e4e776149934322b08c623041f2b45
parent1b6d63938a9d868df01d5bc6e2da212133121b8d
userfaultfd: hugetlbfs: fix new flag usage in error path

In commit d6995da31122 ("hugetlb: use page.private for hugetlb specific
page flags") the use of PagePrivate to indicate a reservation count
should be restored at free time was changed to the hugetlb specific flag
HPageRestoreReserve.  Changes to a userfaultfd error path as well as a
VM_BUG_ON() in remove_inode_hugepages() were overlooked.

Users could see incorrect hugetlb reserve counts if they experience an
error with a UFFDIO_COPY operation.  Specifically, this would be the
result of an unlikely copy_huge_page_from_user error.  There is not an
increased chance of hitting the VM_BUG_ON.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: d6995da31122 ("hugetlb: use page.private for hugetlb specific page flags")
Signed-off-by: Mike Kravetz <[email protected]>
Reviewed-by: Mina Almasry <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Mina Almasry <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/hugetlbfs/inode.c
mm/userfaultfd.c
This page took 0.050856 seconds and 4 git commands to generate.