On Wed, Jan 20, 2021 at 07:04:14PM +0100, Christian Jullien wrote:

> Fortunalety, OpenBSD has mquery specific call which does exactly what I need
> to find a valid start address.
> Porting a software is sometimes very easy, sometimes it needs some
> adaptations.
> I'm fine with mquery.

To state the obvious: your original code doing mmap(...MAP_FIXED...)
only works by accident on other systems. Due to address space size
and/or randomization differences your code just got lucky on those
systems.

Just don't use it mmap(...MAP_FIXED...).

        -Otto

> 
> Christian
> 
> -----Original Message-----
> From: Theo de Raadt [mailto:[email protected]] 
> Sent: Wednesday, January 20, 2021 18:01
> To: [email protected]
> Cc: 'Otto Moerbeek'; [email protected]
> Subject: Re: munmap sometimes does coredump on arm after mmap success
> 
> > Even if the behavior is still strange for me, I accept how it behaves on
> > OpenBSD.
> 
> mmap and munmap work the same on all systems.
> 
> You are just less likely to replace used memory, which is relied upon.
>  
> 

Reply via email to