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



The following reply was made to PR kern/49692; it has been noted by GNATS.

From: Justin Cormack <justin%specialbusservice.com@localhost>
To: Martin Husemann <martin%duskware.de@localhost>
Cc: gnats-bugs%netbsd.org@localhost, kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
	netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/49692: impossibly large mmap does not fail
Date: Tue, 24 Feb 2015 19:01:46 +0000

 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