Hi Mark, I think the confusion arises from your current understanding of how accessible "kernel objects" are to userspace. Specifically:
The user level resource managers can access both the kernel memory and other memory as well because they have capabilities to both.
The thing is, kernel objects are not accessible to userspace. Userspace can *refer* to them via the numerical indexes of their capability token. We call these numerical indexes "capability-pointers" (CPtrs), which are not to be confused with "capabilities", which are themselves also kernel-objects (and therefore, inaccessible to userspace). Userspace can ask the kernel to perform operations on a kernel object by invoking a capability to that kernel object (and the capability is specified to the kernel as a CPtr).
A simple way to think about how the kernel prevents userspace from accessible kernel objects, is to realize that after a chunk of untyped memory has been retyped into an object, say, a Frame or TCB, that new object (the Frame or TCB) cannot be retyped further. The untyped memory has been made into a kernel object, and userspace cannot access kernel memory. In order to transform that object into something else, you'd need to destroy the TCB, and then re-retype the original untyped into something new.
In the case of Frame objects however, the special operation of combining a Frame object with a PageTable object using the "PageMap()" invocation causes the Frame to become visible to userspace as a result of the fact that the PageMap operation manipulates the hardware MMU to make the Frame visible to within the virtual address space. You cannot however, do a "PageMap" that maps a TCB into a VSpace. Only Frames can be mapped into VSpaces, so they are the only kernel objects that can be viewed by userspace.?
Fortunately, the kernel doesn't access Frame objects for any reason other than to zero them when they are being created, or in the case of the IPC buffer, to read and write the IPC buffer fields. For every other kind of kernel object, there's no way to map the kernel objects to be viewable by userspace.
Kofi Doku Atuah
Kernel engineer
DATA61 | CSIRO
E kofidoku.atuah@data61.csiro.au
www.data61.csiro.au
CSIRO's Digital Productivity business unit and NICTA have joined forces to create digital powerhouse Data61
________________________________
From: Devel