Re: mremap() use is racy

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

 



Linus Torvalds wrote:
> Actually, it should be pretty much as valid as using mremap - ie it works 
> on Linux. 
> 
> Especially if you use MAP_SHARED, you don't even need to mprotect 
> anything: you'll get a nice SIGBUS if you ever try to access past the last 
> page that maps the file.

If you guarantee this (and test for this) it's fine with me.  The POSIX
spec explicitly leaves this undefined and requiring to use mremap()
would be a nice way to work around this without allowing the
introduction of undefined behavior into programs.  I probably would
prefer to use mremap() since this makes it clear what should happen but
I can live with using the too-large mapping.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux