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: 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.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index