Re: [PATCH] Smack: SMACK_IOCLOADACCESS

From: Eric Paris
Date: Fri Aug 26 2011 - 20:16:46 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/