[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GDB testsuite: »Memory at address 0 is possibly executable«
From: |
Justus Winter |
Subject: |
Re: GDB testsuite: »Memory at address 0 is possibly executable« |
Date: |
Sat, 13 Sep 2014 02:40:17 +0200 |
User-agent: |
alot/0.3.5 |
Quoting Samuel Thibault (2014-09-13 01:39:05)
> So it seems we need what is not actually documented, i.e. a vm_map
> with anywhere=1, but which takes into account the suggested address.
> I'm fine with officially supporting that, we just need to fix the
> documentation,
I'm sorry, I'm lost. What other interpretation of 'anywhere' is
there? And since you aligned the semantic of vm_maps 'anywhere' with
'vm_allocate', then it follows that the current interpretation is
either wrong or right for both functions, no?
I just looked at mmap(2). If one specifies a non-NULL address, Linux
will use the address as hint. If it is NULL, and MAP_FIXED is not
given, Linux choses a suitable address. It isn't explicitly stated,
but I'm pretty sure the Linux kernel doesn't consider the zero page a
suitable place.
> and fix all places which weren't aware of this behavior (there are
> very few).
How would I chose a suitable address? E.g. ext2fs/dir.c initializes
the address to 0, but then vm_map_enter would set it to
map->min_offset anyway (or map->min_offset is 0), which is the same as
vm_map_min(map).
Justus
Re: GDB testsuite: »Memory at address 0 is possibly executable«, Richard Braun, 2014/09/13