Deleted Added
full compact
mac_lomac.c (168977) mac_lomac.c (170307)
1/*-
2 * Copyright (c) 1999-2002, 2007 Robert N. M. Watson
3 * Copyright (c) 2001-2005 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by NAI Labs,

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
1/*-
2 * Copyright (c) 1999-2002, 2007 Robert N. M. Watson
3 * Copyright (c) 2001-2005 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by NAI Labs,

--- 17 unchanged lines hidden (view full) ---

26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/security/mac_lomac/mac_lomac.c 168977 2007-04-23 13:36:54Z rwatson $
34 * $FreeBSD: head/sys/security/mac_lomac/mac_lomac.c 170307 2007-06-05 00:00:57Z jeff $
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 *
40 * Low-watermark floating label mandatory integrity policy.
41 */
42

--- 488 unchanged lines hidden (view full) ---

531 * high side will always be demoted, of course.
532 */
533 mac_lomac_copy_range(subjlabel, &subj->mac_lomac);
534 if (!mac_lomac_dominate_element(&objlabel->ml_single,
535 &subj->mac_lomac.ml_rangelow))
536 subj->mac_lomac.ml_rangelow = objlabel->ml_single;
537 subj->mac_lomac.ml_rangehigh = objlabel->ml_single;
538 subj->mac_lomac.ml_flags |= MAC_LOMAC_FLAG_UPDATE;
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 *
40 * Low-watermark floating label mandatory integrity policy.
41 */
42

--- 488 unchanged lines hidden (view full) ---

531 * high side will always be demoted, of course.
532 */
533 mac_lomac_copy_range(subjlabel, &subj->mac_lomac);
534 if (!mac_lomac_dominate_element(&objlabel->ml_single,
535 &subj->mac_lomac.ml_rangelow))
536 subj->mac_lomac.ml_rangelow = objlabel->ml_single;
537 subj->mac_lomac.ml_rangehigh = objlabel->ml_single;
538 subj->mac_lomac.ml_flags |= MAC_LOMAC_FLAG_UPDATE;
539 mtx_lock_spin(&sched_lock);
539 thread_lock(curthread);
540 curthread->td_flags |= TDF_ASTPENDING;
541 curthread->td_proc->p_sflag |= PS_MACPEND;
540 curthread->td_flags |= TDF_ASTPENDING;
541 curthread->td_proc->p_sflag |= PS_MACPEND;
542 mtx_unlock_spin(&sched_lock);
542 thread_unlock(curthread);
543
544 /*
545 * Avoid memory allocation while holding a mutex; cache the
546 * label.
547 */
548 mac_lomac_copy_single(&subj->mac_lomac, &cached_subjlabel);
549 mtx_unlock(&subj->mtx);
550

--- 2411 unchanged lines hidden ---
543
544 /*
545 * Avoid memory allocation while holding a mutex; cache the
546 * label.
547 */
548 mac_lomac_copy_single(&subj->mac_lomac, &cached_subjlabel);
549 mtx_unlock(&subj->mtx);
550

--- 2411 unchanged lines hidden ---