Re: [PATCH] Smack: SMACK_IOCLOADACCESS

Eric Paris
2011-08-27T00:16:36Z

On 08/26/2011 05:59 PM, Casey Schaufler wrote:
> On 8/26/2011 10:01 AM, Eric Paris wrote:

> Better to have a single question answered as required and with
> complete accuracy than to carry around the baggage necessary to
> maintain a cached duplicate of the kernel's rules and all the
> bookkeeping that requires. SELinux libraries probably have to
> make a system call just to determine if the caches they are
> maintaining are out of date.

Come on Casey, this is Linux. We have choices! I believe there are
currently 3 solutions to solving the 'out of date caches' problem. The
first and oldest is just a syscall per access request option (I think it
does read() but don't remember). There is an option to get a netlink
message informing you to flush your cache. SE-XWindows found that ONE
syscall per check was WAY WAY WAY too much overhead and uses this
method. There is also a magic selinuxfs file which a userspace process
can mmap and just read the memory location to tell if a reload occurred.
SE-PostgreSQL uses this method because their software architecture did
not have a good way to handle a netlink socket.

The value of the userspace cache is admittedly entirely a question of
the willingness to accept the overhead of kernel lookups.

/me checks out of thread.

-Eric