linux-mips
[Top] [All Lists]

Re: Kernel/User Memory Access and Original Sin

To: kevink@mips.com (Kevin D. Kissell)
Subject: Re: Kernel/User Memory Access and Original Sin
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Mon, 28 Feb 2000 13:27:02 +0000 (GMT)
Cc: linux-mips@fnet.fr (Linux/MIPS fnet), linux-porters@algor.co.uk (Linux/MIPS algor), linux@cthulhu.engr.sgi.com (Linux SGI)
In-reply-to: <010101bf81e6$9c546120$0ceca8c0@satanas.mips.com> from "Kevin D. Kissell" at Feb 28, 2000 01:23:17 PM
Sender: owner-linuxmips@oss.sgi.com
> Linux, as written for the x86, goes very heavily for inlining.
> Rather than call specially protected copyin/copyout sorts
> of routines for manipulating user memory, Linux uses inline
> macros (copy_from_user/copy_to_user, etc.) that depend on

Its up to the port how it is done. Most of them are non inline for
x86 for example.

> __access_ok routine, but it is much more heavyweight
> than the old heuristic.  Not only does it need to check the
> virtual address against the process' VMAs, but it needs

Its broken if it does that. The process VMA may change on an SMP box or
during fault handling sleeps.

__access_ok has one purpose. To verify the address range given is entirely
sensible to feed to __copy_*_user. If you have to do handling the complex
way (eg if your cpu design requires it) then __access_ok can just return 1
and the __copy_*_user - inline or out of line - can do all the work.





<Prev in Thread] Current Thread [Next in Thread>