[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rep:Re: Rep:Re: [f-cpu] TLB resume



On Fri, Aug 09, 2002 at 12:52:33AM +0200, nico wrote:
[...]
> > Consider this system call:
> > 
> >         read(fd, &kernel_page, page_length);
> > 
> 
> Why you're read can't check if the given pages are a real user one ?
> It's easy under linux 0-2Gb is for process, 2-4 Gb AS is for kernel.

It's not always so easy. You'll have to check the memory mappings of
the user process (in software) which may become quite expensive.

> How you're 3 bits right for superuser could avoid this ?

By turning off supervisor access rights for pages that are mapped in user
mode (or maybe set the supervisor privileges to the same value). If the
kernel is really going to do something that the user is not permitted
to do, it will have to a) temporarily raise its own privileges, or b)
establish its own TLB entry with appropriate access rights (but its
own ASI).

Note that it may be possible to use a single set of access bits - if
they are valid for both user and supervisor mode (I'll have to think
that over). But `supervisor mode is allowed to access everything' is a
BIG mistake.

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/