From: Justin Carlson <justin@cs.cmu.edu>
To: Carsten Langgaard <carstenl@mips.com>
Cc: linux-mips@oss.sgi.com
Subject: Re: __access_ok
Date: 17 Jun 2002 09:24:58 -0700 [thread overview]
Message-ID: <1024331098.1463.3.camel@localhost.localdomain> (raw)
In-Reply-To: <3D0DCDCB.252F5565@mips.com>
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.
-Justin
next prev parent reply other threads:[~2002-06-17 16:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-17 11:53 __access_ok Carsten Langgaard
2002-06-17 16:24 ` Justin Carlson [this message]
2002-06-18 7:44 ` __access_ok Carsten Langgaard
2002-06-17 19:55 ` __access_ok Jun Sun
2002-06-18 7:38 ` __access_ok Carsten Langgaard
2002-06-19 9:17 ` __access_ok Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1024331098.1463.3.camel@localhost.localdomain \
--to=justin@cs.cmu.edu \
--cc=carstenl@mips.com \
--cc=linux-mips@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.