summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_lomac
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't implement mpo_destroy() for Biba, LOMAC, and MLS, as theyrwatson2003-11-171-7/+0
| | | | | | | aren't allowed to be unloaded. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Implement sockets support for __mac_get_fd() and __mac_set_fd()rwatson2003-11-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | system calls, and prefer these calls over getsockopt()/setsockopt() for ABI reasons. When addressing UNIX domain sockets, these calls retrieve and modify the socket label, not the label of the rendezvous vnode. - Create mac_copy_socket_label() entry point based on mac_copy_pipe_label() entry point, intended to copy the socket label into temporary storage that doesn't require a socket lock to be held (currently Giant). - Implement mac_copy_socket_label() for various policies. - Expose socket label allocation, free, internalize, externalize entry points as non-static from mac_net.c. - Use mac_socket_label_set() in __mac_set_fd(). MAC-aware applications may now use mac_get_fd(), mac_set_fd(), and mac_get_peer() to retrieve and set various socket labels without directly invoking the getsockopt() interface. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Modify the MAC Framework so that instead of embedding a (struct label)rwatson2003-11-121-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in various kernel objects to represent security data, we embed a (struct label *) pointer, which now references labels allocated using a UMA zone (mac_label.c). This allows the size and shape of struct label to be varied without changing the size and shape of these kernel objects, which become part of the frozen ABI with 5-STABLE. This opens the door for boot-time selection of the number of label slots, and hence changes to the bound on the number of simultaneous labeled policies at boot-time instead of compile-time. This also makes it easier to embed label references in new objects as required for locking/caching with fine-grained network stack locking, such as inpcb structures. This change also moves us further in the direction of hiding the structure of kernel objects from MAC policy modules, not to mention dramatically reducing the number of '&' symbols appearing in both the MAC Framework and MAC policy modules, and improving readability. While this results in minimal performance change with MAC enabled, it will observably shrink the size of a number of critical kernel data structures for the !MAC case, and should have a small (but measurable) performance benefit (i.e., struct vnode, struct socket) do to memory conservation and reduced cost of zeroing memory. NOTE: Users of MAC must recompile their kernel and all MAC modules as a result of this change. Because this is an API change, third party MAC modules will also need to be updated to make less use of the '&' symbol. Suggestions from: bmilekic Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Replace a '-' with a ')'. Update copyright.rwatson2003-11-081-2/+2
| | | | PR: 53195
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-4/+2
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Line-break sync to the MAC development branch.rwatson2003-10-211-1/+2
|
* Correct logic for filling out a "new" label during a credentialrwatson2003-08-211-7/+29
| | | | | | | | | | | | | | | | | | | change in mac_lomac: if both flags are set on the new label, we may not need to always fill out the label (only if one flag is set, not both). Avoid stomping on a section of the label if we are in fact modifying both elements. Because we know that both flags will be set, we don't need to test whether the range or single are set in later consistency checks of the range and single -- just test them. By checking the range of the new vs. the range of the old label before testing the single against the new range, we implicitly test that the new single is in the old range. Document this with a comment. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Remove trailing whitespace.rwatson2003-07-051-1/+1
|
* Redesign the externalization APIs from the MAC Framework torwatson2003-06-231-105/+66
| | | | | | | | | | | | | | | | | | | | | | | | | the MAC policy modules to improve robustness against C string bugs and vulnerabilities. Following these revisions, all string construction of labels for export to userspace (or elsewhere) is performed using the sbuf API, which prevents the consumer from having to perform laborious and intricate pointer and buffer checks. This substantially simplifies the externalization logic, both at the MAC Framework level, and in individual policies; this becomes especially useful when policies export more complex label data, such as with compartments in Biba and MLS. Bundled in here are some other minor fixes associated with externalization: including avoiding malloc while holding the process mutex in mac_lomac, and hence avoid a failure mode when printing labels during a downgrade operation due to the removal of the M_NOWAIT case. This has been running in the MAC development tree for about three weeks without problems. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Also implement mpo_copy_mbuf_label() for mac_lomac, or labels mayrwatson2003-06-021-0/+1
| | | | | | | not be properly propagated across some mbuf copy operations. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Remove double return()phk2003-05-311-2/+0
| | | | Found by: FlexeLint
* Enable the MAC_ALWAYS_LABEL_MBUF flag for the Biba, LOMAC, MLS, and Testrwatson2003-04-151-1/+1
| | | | | | | policies. Missed in earlier merge. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Modify the mac_init_ipq() MAC Framework entry point to accept anrwatson2003-03-261-1/+1
| | | | | | | | | | | | | additional flags argument to indicate blocking disposition, and pass in M_NOWAIT from the IP reassembly code to indicate that blocking is not OK when labeling a new IP fragment reassembly queue. This should eliminate some of the WITNESS warnings that have started popping up since fine-grained IP stack locking started going in; if memory allocation fails, the creation of the fragment queue will be aborted. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Move a bunch of flags from the KSE to the thread.julian2003-02-171-1/+1
| | | | | | | | I was in two minds as to where to put them in the first case.. I should have listenned to the other mind. Submitted by: parts by davidxu@ Reviewed by: jeff@ mini@
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Fix warnings on 64bits architectures.mux2003-01-061-2/+1
| | | | Noticed by: alpha tinderbox
* Default policies to on: if you load them or compile them into yourrwatson2002-12-101-1/+1
| | | | | | | | | | kernel, you should expect them to do something, so now they do. This doesn't affect users who don't load or explicitly compile in the policies. Approved by: re (jhb) Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Remove dm_root entry from struct devfs_mount. It's never set, and isrwatson2002-12-091-8/+10
| | | | | | | | | | | | unused. Replace it with a dm_mount back-pointer to the struct mount that the devfs_mount is associated with. Export that pointer to MAC Framework entry points, where all current policies don't use the pointer. This permits the SEBSD port of SELinux's FLASK/TE to compile out-of-the-box on 5.0-CURRENT with full file system labeling support. Approved by: re (murray) Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Remove a const that generates a warning: the const isn't strictlyrwatson2002-12-041-1/+1
| | | | | | | | | wrong, since we don't want the variable changed, but since we assign it to variables that may also refer to other non-const strings, warnings were generated that could break LINT. Approved by: re Spotted by: sam
* License tweak: remove clause 3 per permission of NAI.rwatson2002-12-032-6/+0
| | | | | | Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Correct two warnings by staticizing a function and removing an unusedrwatson2002-11-261-11/+1
| | | | | | | | function. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Import an implementation of LOMAC (Low-Watermark Mandatory Accessrwatson2002-11-262-0/+2842
Control) as a MAC Framework policy module. Unlike the existing src/sys/security/lomac implementation, this one has its fingers out of the kernel lock order and doesn't make use of flags in existing kernel structures. This greatly reduces the quantity of replicated code with src/sys/kern, simplifies the implementation (3000 vs 8500 lines), and correctes a number of known stability problems with the existing LOMAC implementation, which will be removed. A bit more hooking up to do here. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
OpenPOWER on IntegriCloud