Deleted Added
sdiff udiff text old ( 204581 ) new ( 225344 )
full compact
1/*-
2 * Copyright (c) 1999-2002, 2007-2009 Robert N. M. Watson
3 * Copyright (c) 2001-2005 McAfee, Inc.
4 * Copyright (c) 2006 SPARTA, Inc.
5 * All rights reserved.
6 *
7 * This software was developed by Robert Watson for the TrustedBSD Project.
8 *
9 * This software was developed for the FreeBSD Project in part by McAfee
10 * Research, the Security Research Division of McAfee, Inc. under
11 * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
12 * CHATS research program.
13 *
14 * This software was enhanced by SPARTA ISSO under SPAWAR contract
15 * N66001-04-C-6019 ("SEFOS").
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.

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

30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * $FreeBSD: head/sys/security/mac_biba/mac_biba.c 204581 2010-03-02 15:05:48Z rwatson $
39 */
40
41/*
42 * Developed by the TrustedBSD Project.
43 *
44 * Biba fixed label mandatory integrity policy.
45 */
46

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

1617
1618 if (!biba_dominate_effective(subj, obj))
1619 return (EACCES);
1620
1621 return (0);
1622}
1623
1624static int
1625biba_posixsem_check_write(struct ucred *active_cred, struct ucred *file_cred,
1626 struct ksem *ks, struct label *kslabel)
1627{
1628 struct mac_biba *subj, *obj;
1629
1630 if (!biba_enabled)
1631 return (0);
1632

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

1664 struct mac_biba *source, *dest;
1665
1666 source = SLOT(cred->cr_label);
1667 dest = SLOT(kslabel);
1668
1669 biba_copy_effective(source, dest);
1670}
1671
1672/*
1673 * Some system privileges are allowed regardless of integrity grade; others
1674 * are allowed only when running with privilege with respect to the Biba
1675 * policy as they might otherwise allow bypassing of the integrity policy.
1676 */
1677static int
1678biba_priv_check(struct ucred *cred, int priv)
1679{

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

3450 .mpo_pipe_externalize_label = biba_externalize_label,
3451 .mpo_pipe_init_label = biba_init_label,
3452 .mpo_pipe_internalize_label = biba_internalize_label,
3453 .mpo_pipe_relabel = biba_pipe_relabel,
3454
3455 .mpo_posixsem_check_getvalue = biba_posixsem_check_rdonly,
3456 .mpo_posixsem_check_open = biba_posixsem_check_openunlink,
3457 .mpo_posixsem_check_post = biba_posixsem_check_write,
3458 .mpo_posixsem_check_stat = biba_posixsem_check_rdonly,
3459 .mpo_posixsem_check_unlink = biba_posixsem_check_openunlink,
3460 .mpo_posixsem_check_wait = biba_posixsem_check_write,
3461 .mpo_posixsem_create = biba_posixsem_create,
3462 .mpo_posixsem_destroy_label = biba_destroy_label,
3463 .mpo_posixsem_init_label = biba_init_label,
3464
3465 .mpo_priv_check = biba_priv_check,
3466
3467 .mpo_proc_check_debug = biba_proc_check_debug,
3468 .mpo_proc_check_sched = biba_proc_check_sched,
3469 .mpo_proc_check_signal = biba_proc_check_signal,
3470
3471 .mpo_socket_check_deliver = biba_socket_check_deliver,
3472 .mpo_socket_check_relabel = biba_socket_check_relabel,

--- 106 unchanged lines hidden ---