[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-bugs
Subject:    Re: munmap sometimes does coredump on arm after mmap success
From:       Otto Moerbeek <otto () drijf ! net>
Date:       2021-01-21 7:01:38
Message-ID: YAkm0ox19YF8BwLy () clue ! drijf ! net
[Download RAW message or body]

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:deraadt@openbsd.org] 
> Sent: Wednesday, January 20, 2021 18:01
> To: jullien@eligis.com
> Cc: 'Otto Moerbeek'; bugs@openbsd.org
> 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.
>  
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic