NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/49692: impossibly large mmap does not fail



On 24 February 2015 at 18:53, Martin Husemann <martin%duskware.de@localhost> wrote:
> Note that -1 is not a multiple of the machines PAGE_SIZE, so it gets
> rounded up to the next full page.

Ah yes, -8192 say is ok and gives ENOMEM. But it is size_t so it is
unsigned, so with *size_t)-1 that is an unsigned overflow to 0 that is
taking place, which is undefined behaviour.

Justin


Home | Main Index | Thread Index | Old Index