]> git.baikalelectronics.ru Git - kernel.git/commit
mm/migrate: fix indexing bug (off by one) and avoid out of bound access
authorMark Hairgrove <mhairgrove@nvidia.com>
Fri, 13 Oct 2017 22:57:30 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Oct 2017 23:18:32 +0000 (16:18 -0700)
commit9782621d5fcb9d6a913c491bd4856e34b5234795
treee1970efcd1f2792fc95c2fbd9054c59cb83c578a
parent799e1e61a44fcda69657fca94ff663db3eb7c301
mm/migrate: fix indexing bug (off by one) and avoid out of bound access

Index was incremented before last use and thus the second array could
dereference to an invalid address (not mentioning the fact that it did
not properly clear the entry we intended to clear).

Link: http://lkml.kernel.org/r/1506973525-16491-1-git-send-email-jglisse@redhat.com
Fixes: 29c4070225585f ("mm/migrate: allow migrate_vma() to alloc new page on empty entry")
Signed-off-by: Mark Hairgrove <mhairgrove@nvidia.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: Reza Arbab <arbab@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/migrate.c