* [merged] mm-mremap-fix-extent-calculation.patch removed from -mm tree
@ 2020-12-31 18:22 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2020-12-31 18:22 UTC (permalink / raw)
To: deller, kaleshsingh, kirill.shutemov, linux, lokeshgidra,
minchan, mm-commits, surenb
The patch titled
Subject: mm/mremap.c: fix extent calculation
has been removed from the -mm tree. Its filename was
mm-mremap-fix-extent-calculation.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Kalesh Singh <kaleshsingh@google.com>
Subject: mm/mremap.c: fix extent calculation
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/20201219170433.2418867-1-kaleshsingh@google.com
Fixes: c49dd34018026 ("mm: speedup mremap on 1GB or larger regions")
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/mremap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/mm/mremap.c~mm-mremap-fix-extent-calculation
+++ a/mm/mremap.c
@@ -358,7 +358,9 @@ static unsigned long get_extent(enum pgt
next = (old_addr + size) & mask;
/* even if next overflowed, extent below will be ok */
- extent = (next > old_end) ? old_end - old_addr : next - old_addr;
+ extent = next - old_addr;
+ if (extent > old_end - old_addr)
+ extent = old_end - old_addr;
next = (new_addr + size) & mask;
if (extent > next - new_addr)
extent = next - new_addr;
_
Patches currently in -mm which might be from kaleshsingh@google.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-31 18:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 18:22 [merged] mm-mremap-fix-extent-calculation.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.