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: Joerg Sonnenberger <joerg%britannica.bec.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/49692: impossibly large mmap does not fail
Date: Sun, 1 Mar 2015 14:01:34 +0100

 On Sun, Mar 01, 2015 at 06:40:01AM +0000, David Holland wrote:
 > The following reply was made to PR kern/49692; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-bugs%netbsd.org@localhost>
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc: 
 > Subject: Re: kern/49692: impossibly large mmap does not fail
 > Date: Sun, 1 Mar 2015 06:35:08 +0000
 > 
 >  On Tue, Feb 24, 2015 at 07:05:00PM +0000, Justin Cormack wrote:
 >   >  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.
 >  
 >  Eh wut? No it isn't. It's signed overflow that's undefined.
 
 I still believe that we should catch it in the system call.
 
 Joerg
 


Home | Main Index | Thread Index | Old Index