This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC] Allow explicit shrinking of arena heaps using anenvironment variable


On Sat, Jul 21, 2012 at 08:37:11AM +0530, Siddhesh Poyarekar wrote:
> On 21 July 2012 08:10, Rich Felker <dalias@aerifal.cx> wrote:
> > It does not give regular programs extra security. The "security"
> > benefit for suid programs is that data freed before the program drops
> > privileges has a better chance of being obliterated by the time
> > privileges are dropped, at which time there's a good possibility that
> > the real user who invoked the program might be able to access its
> > memory.
> 
> Based on the madvise man page (and also comments earlier in the
> thread), MADV_DONTNEED also always[1] zeroes pages before subsequent
> accesses to it, so isn't the page protection the only additional
> action that the overlapping mmap provides? It shouldn't matter when
> the pages get zeroed, since from the real user perspective, they're
> zeroed pages.

mprotect is not to prevent them from being accessed. It's to subtract
them from the commit charge. Clean PROT_NONE pages do not contribute
to commit charge. Writable pages do contribute to commit charge even
if they're clean.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]