Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When `next < old_addr`, `next - old_addr` arithmetic underflows causing `extent` to be incorrect. Make `extent` the smaller of `next - old_addr` or `old_end - old_addr`. Link: https://lkml.kernel.org/r/[email protected] Fixes: c49dd34 ("mm: speedup mremap on 1GB or larger regions") Signed-off-by: Kalesh Singh <[email protected]> Reported-by: Guenter Roeck <[email protected]> Tested-by: Guenter Roeck <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Lokesh Gidra <[email protected]> Cc: Helge Deller <[email protected]> Cc: Kalesh Singh <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information