Re: [PATCH] Expose range-checking functions from arch-specific uaccess.h

2007-04-03 Thread Rusty Russell
On Tue, 2007-04-03 at 20:22 -0700, Randy Dunlap wrote: > > +/** > > + * val_outside - is a value and length past a limit? > > + * @val: the start value > > + * @len: the length from the start > > + * @limit: the first invalid value > > + * > > + * Like val + len > limit, except with overflow checki

Re: [PATCH] Expose range-checking functions from arch-specific uaccess.h

2007-04-03 Thread Randy Dunlap
On Wed, 04 Apr 2007 12:28:38 +1000 Rusty Russell wrote: > lguest wants range checking, but unless there are other users I'm not > sure this is worth the pain. Putting it out there in case it's useful. > > Cheers, > Rusty. > == > There are some places where we want to check if a value + length is

[PATCH] Expose range-checking functions from arch-specific uaccess.h

2007-04-03 Thread Rusty Russell
lguest wants range checking, but unless there are other users I'm not sure this is worth the pain. Putting it out there in case it's useful. Cheers, Rusty. == There are some places where we want to check if a value + length is within a range. This can be tricky, so it's nice to have a single rou