Current-Users archive

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

Re: Some fixes in MI code regarding PAE

On Fri, 8 Jan 2010, Manuel Bouyer wrote:

> On Fri, Jan 08, 2010 at 01:41:40AM +0100, Jean-Yves Migeon wrote:

> > Explanations:
> > - printfs using PRIxADDR instead of hardcoding long types in format
> > - ptoa() => ctob() + cast to uint64_t (when necessary) for integer 
> > values that could be higher than 1M, risking truncation when casted to 
> > vaddr_t via ptoa().
> I think the rlimit part is still wrong. rlim_cur is a int, so storing a
> 64bit value, possibly larger than 4Gb in a 32bit int will cause trouble.
> In this case the overflow needs to be detected and a sensible value
> needs to be used instead. Otherwise, you may end up with a very low RSS
> limit preventing userland from running.

Uh... No, rlimits are rlim_t which are uint64_t.  But you are correct that 
this might cause trouble if we ever bothered to check it.  

I think you should cap the RSS limit ar VM_MAXUSER_ADDRESS in case someone 
ever enhances UVM to track RSS.  There is little point in having more 
pages resident than you are allowed to address.

OTOH I doubt this bug will have any noticeable effect.


Home | Main Index | Thread Index | Old Index