summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mac.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Close a race in process label changing opened due to dropping therwatson2002-08-191-7/+10
| | | | | | | | | | proc locking when revoking access to mmaps. Instead, perform this later once we've changed the process label (hold onto a reference to the new cred so that we don't lose it when we release the process lock if another thread changes the credential). Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Pass active_cred and file_cred into the MAC framework explicitlyrwatson2002-08-191-12/+20
| | | | | | | | | | | for mac_check_vnode_{poll,read,stat,write}(). Pass in fp->f_cred when calling these checks with a struct file available. Otherwise, pass NOCRED. All currently MAC policies use active_cred, but could now offer the cached credential semantic used for the base system security model. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Provide an implementation of mac_syscall() so that security modulesrwatson2002-08-191-0/+38
| | | | | | | | | | | can offer new services without reserving system call numbers, or augmented versions of existing services. User code requests a target policy by name, and specifies the policy-specific API plus target. This is required in particular for our port of SELinux/FLASK to the MAC framework since it offers additional security services. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Break out mac_check_pipe_op() into component check entry points:rwatson2002-08-191-4/+46
| | | | | | | | | | | mac_check_pipe_poll(), mac_check_pipe_read(), mac_check_pipe_stat(), and mac_check_pipe_write(). This is improves consistency with other access control entry points and permits security modules to only control the object methods that they are interested in, avoiding switch statements. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Break out mac_check_vnode_op() into three seperate checks:rwatson2002-08-191-10/+57
| | | | | | | | | | mac_check_vnode_poll(), mac_check_vnode_read(), mac_check_vnode_write(). This improves the consistency with other existing vnode checks, and allows policies to avoid implementing switch statements to determine what operations they do and do not want to authorize. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Assert process locks in proces-related access control checks.rwatson2002-08-191-0/+6
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Add a missing vnode assertion for the exec() check.rwatson2002-08-191-0/+2
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Wrap maintenance of varios nmac{objectname} counters in MAC_DEBUG so werwatson2002-08-161-0/+46
| | | | | | | | can avoid the cost of a large number of atomic operations if we're not interested in the object count statistics. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Rename mac_check_socket_receive() to mac_check_socket_deliver() so thatrwatson2002-08-151-10/+10
| | | | | | | | | | | | | we can use the names _receive() and _send() for the receive() and send() checks. Rename related constants, policy implementations, etc. PR: Submitted by: Reviewed by: Approved by: Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs MFC after:
* Sync to trustedbsd_mac tree: default to sigsegv rather than copy-on-writerwatson2002-08-151-1/+1
| | | | | | | | | during a label change resulting in an mmap removal. This is "fail stop" behavior, which is preferred, although it offers slightly less transparency. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Declare a module service "kernel_mac_support" when MAC support isrwatson2002-08-121-0/+8
| | | | | | | | | | | | | | | enabled and the kernel provides the MAC registration and entry point service. Declare a dependency on that module service for any MAC module registered using mac_policy.h. For now, hard code the version as 1, but once we've come up with a versioning policy, we'll move to a #define of some sort. In the mean time, this will prevent loading a MAC module when 'options MAC' isn't present, which (due to a bug in the kernel linker) can result if the MAC module is preloaded via loader.conf. This particular evil recommended by: peter Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI LAbs
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-5/+7
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* Include file cleanup; mac.h and malloc.h at one point had orderingrwatson2002-08-011-0/+1
| | | | | | relationship requirements, and no longer do. Reminded by: bde
* Begin committing support for Mandatory Access Control and extensiblerwatson2002-07-301-0/+3016
| | | | | | | | | | | | | | | | | | | | kernel access control. The MAC framework permits loadable kernel modules to link to the kernel at compile-time, boot-time, or run-time, and augment the system security policy. This commit includes the initial kernel implementation, although the interface with the userland components of the oeprating system is still under work, and not all kernel subsystems are supported. Later in this commit sequence, documentation of which kernel subsystems will not work correctly with a kernel compiled with MAC support will be added. kern_mac.c contains the body of the MAC framework. Kernel and user APIs defined in mac.h are implemented here, providing a front end to loaded security modules. This code implements a module registration service, state (label) management, security configuration and policy composition. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Stubs for the TrustedBSD MAC system calls to permit TrustedBSD MACrwatson2002-07-301-0/+93
userland code to operate on kernel's from the main tree. Not much in this file yet. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
OpenPOWER on IntegriCloud