Re: Virtual memory leaking through IA32 emulation layer for mmap and munmap

From: David Mosberger <>
Date: 2004-03-09 12:04:47
>>>>> On Tue, 9 Mar 2004 11:57:47 +1100, Peter Chubb <> said:

>>>>> "David" == David Mosberger <> writes:
  David> Rounded up to the _page-size_ which is 4KB for x86.  In
  David> general, you can't just round up to 16KB for munmap() or all
  David> hell will break lose.

  Peter> As munmap()'s behaviour is undefined on memory that wasn't
  Peter> allocated with mmap(), rounding to the underlaying true page
  Peter> size should work for well-behaved programs.

  Peter>      x = mmap(... 4k ....)  maps a 16k chunk

  Peter>      munmap(x, 4k) deallocates a 16k chunk, if page_size is
  Peter> 16k

  Peter> Of course at present, mmap32 tries to be clever and pretend
  Peter> PAGE_SIZE is 4k, so it doesn't work...

All of this is old news and has come up at least twice in the past.
Don Dugger started to work on a patch to track partial page
allocations but I believe the patch was never finished.  Please check
the mail archives for details.

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Mon Mar 8 20:05:19 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:24 EST