On Tue, 28 Mar 2006, David Laight wrote:This is true. On the other hand, we ended up with a god-awful number of interfaces that each module needs to provide. :-) The LSM/MAC Framework model uses C99 sparse structure initialization to populate large structures of possibly defined function pointers with function pointers defined by the policy. The older MAC Framework, FLASK, and now kauth(9) interface specifies a small number of entry functions but a large number of index value(s) specifying what event it is, which allows interpretation of the arguments. Finding a middle ground between those two is tricky, since the C language wasn't every really meant to be able to do this sort of thing :-). I'm much happier with the newer FreeBSD kernel locking APIs for this very reason -- you can see them separately in trace and profile output, you can substitute definitions at the symbol level, you get strong type checking, etc. All that said, I recognize there is a lot of value to the indexed argument method -- you may lose type checking and the function behavior, but it greatly reduces the amount of C glue required for the registration process, and allows very simple policies to coalesce decision logic if they're able to consistently ignore arguments. TrustedBSD MAC modules tend to be quite long with a lot of fairly empty functions that map the specific typed arguments into something the logic of the policy can operate on. I.e.: static int mac_mls_check_vnode_read(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp, struct label *label) { struct mac_mls *subj, *obj; if (!mac_mls_enabled || !revocation_enabled) return (0); subj = SLOT(active_cred->cr_label); obj = SLOT(label); if (!mac_mls_dominate_effective(subj, obj)) return (EACCES); return (0); } Because the argument order and types of arguments vary, we can't easily combine functions implementing similar checks for different object types. My currently leaning is that the MAC Framework slightly overshot in the direction of specific functions for each check. I'd also like to pass specific label slot pointers in as well as the object pointers so that I can avoid encoding the mapping mechanism from objects to labels. I may get a chance to retrofit all this for FreeBSD 7.0, but am currently preoccupied with finishing up the last of security event audit support for FreeBSD 6.2/7.0. It's nice to think we could end up with a common authorization interface across the relevant BSD's, but in the short term it's hard to see how we would get there. The MAC Framework is much more comprehensive than kauth, providing a variety of entry points for things like "A vnode has been instantiated, initialize it's in-memory label cache", "A vnode has been associated with an inode on a file system with extended attributes, perform I/O to derive the in-memory label", etc. On the other hand, it's much more complicated. We're currently working on optimizing the MAC Framework so it can be turned on by default in the GENERIC kernel, but this is tricky because it supports things like confidentiality, type enforcement, and biba labels on mbufs... :-) If anyone interested in this discussion is going to be at BSDCan, it would be great to have a BOF session on pluggable security frameworks. Having done work with a number of them (RSBAC, LSM, FLASK, TrustedBSD MAC Framework, kauth), I feel like I have something to say on the topic, but also feel the last word hasn't yet been said -- these frameworks all have different properties, making some things easier, and some things harder. Finding one that meets the needs of immediate consumers is, and should be, the driving force behind integration. On the other hand, since it is a framework for pluggable security services, and there are a lot out there, closing the door on the future is also bad. The MAC Framework has successfully integrated things like our SEBSD port of FLASK/TE from SELinux to FreeBSD, which is quite neat, but possibly less practical than providing a good abstraction to put securelevels behind. The MAC Framework has intentionally not addressed the issue of replacing current discretionary access control in FreeBSD, and that's something kauth has addressed, since that was Apple's practical requirement. I have had severral quite long discussions with Mike Smith along these lines, and we both think there's quite a bit more to do. Robert N M Watson
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
| David Miller | Slow DOWN, please!!! |
| Mark Fasheh | [PATCH 0/39] Ocfs2 updates for 2.6.28 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Shawn O. Pearce | Re: pack operation is thrashing my server |
| Pierre Habouzit | git send-email improvements |
| Matthieu Moy | git push to a non-bare repository |
| Shawn O. Pearce | libgit2 - a true git library |
| Elad Efrat | Integrating securelevel and kauth(9) |
| Hubert Feyrer | Re: Compressed vnd handling tested successfully |
| Lord Isildur | Re: Fork bomb protection patch |
| Matt Thomas | Re: FFS journal |
| Will Maier | cron doesn't run commands in /etc/crontab? |
| Richard Stallman | Real men don't attack straw men |
| Harald Dunkel | Re: Packet Filter: how to keep device names on hardware failure? |
| Jordi Espasa Clofent | Resolving dependencies with pkg_add |
| Question on swap as ramdisk partition | 52 minutes ago | Linux kernel |
| Netfilter kernel module | 11 hours ago | Linux kernel |
| serial driver xmit problem | 14 hours ago | Linux kernel |
| Why Windows is better than Linux | 14 hours ago | Linux general |
| How can I see my kernel messages in vt12? | 21 hours ago | Linux kernel |
| Grub | 1 day ago | Linux general |
| vmalloc_fault handling in x86_64 | 1 day ago | Linux kernel |
| epoll_wait()ing on epoll FD | 1 day ago | Linux kernel |
| Framebuffer in x86_64 causes problems to multiseat | 1 day ago | Linux kernel |
| Difference between 2.4 and 2.6 regarding thread creation | 2 days ago | Linux general |
