]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mempolicy: fix mbind_range() arguments to vma_merge()
authorLiam Howlett <liam.howlett@oracle.com>
Sat, 15 Oct 2022 02:12:33 +0000 (02:12 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 21 Oct 2022 04:27:21 +0000 (21:27 -0700)
commit5ef930c7cb8d8299673ea8519a668534b8d41cb9
tree38b72459b233ace549fe1a9940cf145faa632606
parent9abe55085e2e2999f350cded986309a08a7f51e4
mm/mempolicy: fix mbind_range() arguments to vma_merge()

Fuzzing produced an invalid argument to vma_merge() which was caught by
the newly added verification of the number of VMAs being removed on
process exit.  Analyzing the failure eventually resulted in finding an
issue with the search of a VMA that started at address 0, which caused an
underflow and thus the loss of many VMAs being tracked in the tree.  Fix
the underflow by changing the search of the maple tree to use the start
address directly.

Link: https://lkml.kernel.org/r/20221015021135.2816178-1-Liam.Howlett@oracle.com
Fixes: 948563c70b90 ("mm/mempolicy: use vma iterator & maple state instead of vma linked list")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/r/202210052318.5ad10912-oliver.sang@intel.com
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mempolicy.c