[Info-vax] Virtual memory 101 (was Re: Android development...)

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Tue Sep 23 16:02:25 EDT 2014


On 2014-09-23 19:33:40 +0000, JF Mezei said:

> OK, based on Mr Hoffman's message, I understand that system 
> sercvice/user written system services are not granted privileges, they 
> simply get to execute in either exec or kernel mode.

Read the 
<http://h71000.www7.hp.com/doc/73final/5841/5841pro_078.html#user_written_sys> 
documentation.

In particular, and as I mentioned before: "Any code executing in 
executive or kernel mode is granted an implicit SETPRV privilege so it 
can enable any privileges it needs."


> However, my question still stands on how when I branch to a system 
> service (or user written system service), the code is magically granted 
> special status.  (and how that special status is revoked when it 
> branches back.

Again: "Any code executing in executive or kernel mode is granted an 
implicit SETPRV privilege so it can enable any privileges it needs."

The exit path from the UWSS returns to the caller's mode.

If the UWSS code leaves privileges lit on exit, those privileges will 
be available after the UWSS exit.

> Side question:
> 
> When code steps into kernel mode, does it have to bother enabling 
> privileges needed to do the job, or does code execute with all 
> privileges enabled (or more like no privileges checked) ?

"Any code executing in executive or kernel mode is granted an implicit 
SETPRV privilege so it can enable any privileges it needs."

Put another way, the processor mode is the key detail here.  Processor 
mode is the basis for privileges.  Processor mode is the key to system 
security.  Processor mode is the fundamental underpinning of all access 
controls.   Processor mode and the virtual memory mechanisms are the 
core of memory access.    OpenVMS-style privileges are little more than 
some operation- or access-related or gatekeeping granularity that's 
been layered atop the inner-mode code.

Again, it's the inner-mode code and the virtual memory management in 
its simplest form — that's the core of the entire operating system 
environment.

The access mode mechanisms are the underpinnings of most operating 
systems and of most hardware platforms.

Because the system code operates in kernel or system or whatever you 
call the most privileged access mode or most privileged ring, it always 
has implicit SETPRV or "root" or whatever you want to call such access. 
 The kernel-mode code then endeavors to keep the user-mode active 
constrained, whether at the change-mode gates or the privilege checks 
or whatever the local operating system calls the mechanism.

Reading: <http://labs.hoffmanlabs.com/node/228>



-- 
Pure Personal Opinion | HoffmanLabs LLC




More information about the Info-vax mailing list