From: Ralf Baechle <ralf@linux-mips.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: mips64 _access_ok fix
Date: Thu, 11 Sep 2003 16:16:29 +0200 [thread overview]
Message-ID: <20030911141629.GB15365@linux-mips.org> (raw)
In-Reply-To: <20030911.134323.03974731.nemoto@toshiba-tops.co.jp>
On Thu, Sep 11, 2003 at 01:43:23PM +0900, Atsushi Nemoto wrote:
> I know this fix is not complete. __access_ok(0, 0, __access_mask)
> will return 0.
>
> I could not find out good expression (i.e. no conditional branch) to
> handle this case.
>
> I suppose nobody do take care of this since addr 0 is invalid pointer
> anyway.
That behaviour of __access_ok() is actually ok; __access_ok only needs
to return non-zero only for addresses >= TASK_SIZE. For two reason
the case you're mentioning is not a problem. As you say 0 is (usually)
a bad pointer value so if the kernel tries to dereference it, an
TLB exception is going to happen and the exception handling code will
deal with the case. Second the size argument is zero and after all
that means the kernel won't touch the address range anyway because
hey, it's zero-length!
Ralf
next prev parent reply other threads:[~2003-09-11 14:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-11 3:43 mips64 _access_ok fix Atsushi Nemoto
2003-09-11 4:43 ` Atsushi Nemoto
2003-09-11 14:16 ` Ralf Baechle [this message]
2003-09-12 0:34 ` Atsushi Nemoto
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=20030911141629.GB15365@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mips@linux-mips.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox