Den mån 18 nov. 2019 kl 09:45 skrev <[email protected]>:

> I agree, including unnecessary text makes the man page harder to use,
> but I don't see why the memory could not be filled with 0xFF bytes, or
> with bytes coming from /dev/urandom.
>
> Since the man pages are "the authoritative source of information for
> OpenBSD", I am currently forced to assume that the newly allocated
> memory is in an undefined state


On more or less all modern OSes, you can be sure that the memory a program
gets from the general pool of RAM is cleared before it is given to you.
(Not the memory libc reuses during your runtime when you call libc malloc()
but all new pages that you get will never have anyone elses data in it for
very obvious reasons).

Since mmap()ing anonymous pages gives you ram from that place, it will
share this property. Also possible to deduct from this is that pages you
munmap() later will be cleared before anyone else gets them later on. Also,
while docs are very good on OpenBSD, but the ultimate source is of course
the source code you are running.

-- 
May the most significant bit of your life be positive.

Reply via email to