Re: [PATCH] mm: mremap - Fix extent calculation

2020-12-19 Thread Guenter Roeck
On Sat, Dec 19, 2020 at 05:04:33PM +, Kalesh Singh wrote: > 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`. > > Reported-by: Guenter Roeck > Signed-off-by: Kalesh S

[PATCH] mm: mremap - Fix extent calculation

2020-12-19 Thread Kalesh Singh
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`. Reported-by: Guenter Roeck Signed-off-by: Kalesh Singh --- mm/mremap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion