Note, that this is in the 64-bit kernel, a size there the high bit is set,
will be astronomical and not a true value.
Justin Carlson wrote:
> On Mon, 2002-06-17 at 04:53, Carsten Langgaard wrote:
> > * Address valid if:
> > - * - "addr" doesn't have any high-bits set
> > - * - AND "size" doesn't have any high-bits set
> > - * - AND "addr+size" doesn't have any high-bits set
> > - * - OR we are in kernel mode.
> > + * - In user mode and "addr" and "addr+size" in USEG (or XUSEG).
> > + * - OR we are in kernel mode and "addr" and "addr+size" isn't in the
> > + * area between USEG (XUSEG) and KSEG0.
> You also need to test for high bit set in size. Otherwise, for example,
> if a process was ok to access range 0x40000000-0x40003fff,
> access_ok(0x40001000, 0xfffff100) would return 1. The addition will
> wrap around, leading to all sorts of fun havoc.
_ _ ____ ___ Carsten Langgaard Mailto:email@example.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556