aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoao Martins <joao.m.martins@oracle.com>2021-07-14 21:27:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-07-15 10:13:49 -0700
commitd08af0a59684e18a51aa4bfd24c658994ea3fc5b (patch)
tree20183f284e5c2d7f150ed5d359699491ad221af4 /include
parenthfs: add lock nesting notation to hfs_find_init (diff)
downloadlinux-dev-d08af0a59684e18a51aa4bfd24c658994ea3fc5b.tar.xz
linux-dev-d08af0a59684e18a51aa4bfd24c658994ea3fc5b.zip
mm/hugetlb: fix refs calculation from unaligned @vaddr
Commit 82e5d378b0e47 ("mm/hugetlb: refactor subpage recording") refactored the count of subpages but missed an edge case when @vaddr is not aligned to PAGE_SIZE e.g. when close to vma->vm_end. It would then errousnly set @refs to 0 and record_subpages_vmas() wouldn't set the @pages array element to its value, consequently causing the reported null-deref by syzbot. Fix it by aligning down @vaddr by PAGE_SIZE in @refs calculation. Link: https://lkml.kernel.org/r/20210713152440.28650-1-joao.m.martins@oracle.com Fixes: 82e5d378b0e47 ("mm/hugetlb: refactor subpage recording") Reported-by: syzbot+a3fcd59df1b372066f5a@syzkaller.appspotmail.com Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions