Re: [PATCH] linux-user/mmap: Avoid asserts for out of range mremap calls

2021-02-13 Thread Laurent Vivier
Le 08/01/2021 à 18:42, Richard Purdie a écrit : > If mremap() is called without the MREMAP_MAYMOVE flag with a start address > just before the end of memory (reserved_va) where new_size would exceed > it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in  > page_set_flags() would trigg

Re: [PATCH] linux-user/mmap: Avoid asserts for out of range mremap calls

2021-02-13 Thread Laurent Vivier
Le 08/01/2021 à 18:42, Richard Purdie a écrit : > If mremap() is called without the MREMAP_MAYMOVE flag with a start address > just before the end of memory (reserved_va) where new_size would exceed > it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in  > page_set_flags() would trigg

Re: [PATCH] linux-user/mmap: Avoid asserts for out of range mremap calls

2021-01-22 Thread Philippe Mathieu-Daudé
On 1/22/21 10:37 AM, Richard Purdie wrote: > On Fri, 2021-01-08 at 17:42 +, Richard Purdie wrote: >> If mremap() is called without the MREMAP_MAYMOVE flag with a start address >> just before the end of memory (reserved_va) where new_size would exceed >> it (and GUEST_ADDR_MAX), the assert(end

Re: [PATCH] linux-user/mmap: Avoid asserts for out of range mremap calls

2021-01-22 Thread Richard Purdie
On Fri, 2021-01-08 at 17:42 +, Richard Purdie wrote: > If mremap() is called without the MREMAP_MAYMOVE flag with a start address > just before the end of memory (reserved_va) where new_size would exceed > it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in  > page_set_flags() wo

[PATCH] linux-user/mmap: Avoid asserts for out of range mremap calls

2021-01-08 Thread Richard Purdie
If mremap() is called without the MREMAP_MAYMOVE flag with a start address just before the end of memory (reserved_va) where new_size would exceed it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in  page_set_flags() would trigger. Add an extra guard to the guest_range_valid() check