path: root/MAINTAINERS
diff options
authorMike Kravetz <>2021-08-19 19:04:33 -0700
committerLinus Torvalds <>2021-08-20 11:31:42 -0700
commitc7b1850dfb41d0b4154aca8dbc04777fbd75616f (patch)
tree7e03c0a5b3c243af359078b0c5b81b01253be1ca /MAINTAINERS
parenta7cb5d23eaea148f8582229846f8dfff192f05c3 (diff)
hugetlb: don't pass page cache pages to restore_reserve_on_error
syzbot hit kernel BUG at fs/hugetlbfs/inode.c:532 as described in [1]. This BUG triggers if the HPageRestoreReserve flag is set on a page in the page cache. It should never be set, as the routine huge_add_to_page_cache explicitly clears the flag after adding a page to the cache. The only code other than huge page allocation which sets the flag is restore_reserve_on_error. It will potentially set the flag in rare out of memory conditions. syzbot was injecting errors to cause memory allocation errors which exercised this specific path. The code in restore_reserve_on_error is doing the right thing. However, there are instances where pages in the page cache were being passed to restore_reserve_on_error. This is incorrect, as once a page goes into the cache reservation information will not be modified for the page until it is removed from the cache. Error paths do not remove pages from the cache, so even in the case of error, the page will remain in the cache and no reservation adjustment is needed. Modify routines that potentially call restore_reserve_on_error with a page cache page to no longer do so. Note on fixes tag: Prior to commit 846be08578ed ("mm/hugetlb: expand restore_reserve_on_error functionality") the routine would not process page cache pages because the HPageRestoreReserve flag is not set on such pages. Therefore, this issue could not be trigggered. The code added by commit 846be08578ed ("mm/hugetlb: expand restore_reserve_on_error functionality") is needed and correct. It exposed incorrect calls to restore_reserve_on_error which is the root cause addressed by this commit. [1] Link: Fixes: 846be08578ed ("mm/hugetlb: expand restore_reserve_on_error functionality") Signed-off-by: Mike Kravetz <> Reported-by: <> Cc: Mina Almasry <> Cc: Axel Rasmussen <> Cc: Peter Xu <> Cc: Muchun Song <> Cc: Michal Hocko <> Cc: Naoya Horiguchi <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'MAINTAINERS')
0 files changed, 0 insertions, 0 deletions