mac_biba.h (126097) | mac_biba.h (132232) |
---|---|
1/*- 2 * Copyright (c) 1999-2002 Robert N. M. Watson | 1/*- 2 * Copyright (c) 1999-2002 Robert N. M. Watson |
3 * Copyright (c) 2001-2002 Networks Associates Technology, Inc. | 3 * Copyright (c) 2001-2004 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 Network 9 * Associates Laboratories, the Security Research Division of Network 10 * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), 11 * as part of the DARPA CHATS research program. --- 14 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 * | 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 Network 9 * Associates Laboratories, the Security Research Division of Network 10 * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), 11 * as part of the DARPA CHATS research program. --- 14 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_biba/mac_biba.h 126097 2004-02-22 00:33:12Z rwatson $ | 34 * $FreeBSD: head/sys/security/mac_biba/mac_biba.h 132232 2004-07-16 02:03:50Z rwatson $ |
35 */ 36/* 37 * Definitions for the TrustedBSD Biba integrity policy module. 38 */ 39#ifndef _SYS_SECURITY_MAC_BIBA_H 40#define _SYS_SECURITY_MAC_BIBA_H 41 42#define MAC_BIBA_EXTATTR_NAMESPACE EXTATTR_NAMESPACE_SYSTEM 43#define MAC_BIBA_EXTATTR_NAME "mac_biba" 44 45#define MAC_BIBA_LABEL_NAME "biba" 46 | 35 */ 36/* 37 * Definitions for the TrustedBSD Biba integrity policy module. 38 */ 39#ifndef _SYS_SECURITY_MAC_BIBA_H 40#define _SYS_SECURITY_MAC_BIBA_H 41 42#define MAC_BIBA_EXTATTR_NAMESPACE EXTATTR_NAMESPACE_SYSTEM 43#define MAC_BIBA_EXTATTR_NAME "mac_biba" 44 45#define MAC_BIBA_LABEL_NAME "biba" 46 |
47#define MAC_BIBA_FLAG_SINGLE 0x00000001 /* mb_single initialized */ | 47#define MAC_BIBA_FLAG_EFFECTIVE 0x00000001 /* mb_effective initialized */ |
48#define MAC_BIBA_FLAG_RANGE 0x00000002 /* mb_range* initialized */ | 48#define MAC_BIBA_FLAG_RANGE 0x00000002 /* mb_range* initialized */ |
49#define MAC_BIBA_FLAGS_BOTH (MAC_BIBA_FLAG_SINGLE | MAC_BIBA_FLAG_RANGE) | 49#define MAC_BIBA_FLAGS_BOTH (MAC_BIBA_FLAG_EFFECTIVE | MAC_BIBA_FLAG_RANGE) |
50 51#define MAC_BIBA_TYPE_UNDEF 0 /* Undefined */ 52#define MAC_BIBA_TYPE_GRADE 1 /* Hierarchal grade with mb_grade. */ 53#define MAC_BIBA_TYPE_LOW 2 /* Dominated by any 54 * MAC_BIBA_TYPE_LABEL. */ 55#define MAC_BIBA_TYPE_HIGH 3 /* Dominates any 56 * MAC_BIBA_TYPE_LABEL. */ 57#define MAC_BIBA_TYPE_EQUAL 4 /* Equivilent to any --- 10 unchanged lines hidden (view full) --- 68 69struct mac_biba_element { 70 u_short mbe_type; 71 u_short mbe_grade; 72 u_char mbe_compartments[MAC_BIBA_MAX_COMPARTMENTS >> 3]; 73}; 74 75/* | 50 51#define MAC_BIBA_TYPE_UNDEF 0 /* Undefined */ 52#define MAC_BIBA_TYPE_GRADE 1 /* Hierarchal grade with mb_grade. */ 53#define MAC_BIBA_TYPE_LOW 2 /* Dominated by any 54 * MAC_BIBA_TYPE_LABEL. */ 55#define MAC_BIBA_TYPE_HIGH 3 /* Dominates any 56 * MAC_BIBA_TYPE_LABEL. */ 57#define MAC_BIBA_TYPE_EQUAL 4 /* Equivilent to any --- 10 unchanged lines hidden (view full) --- 68 69struct mac_biba_element { 70 u_short mbe_type; 71 u_short mbe_grade; 72 u_char mbe_compartments[MAC_BIBA_MAX_COMPARTMENTS >> 3]; 73}; 74 75/* |
76 * Biba labels consist of two components: a single label, and a label | 76 * Biba labels consist of two components: an effective label, and a label |
77 * range. Depending on the context, one or both may be used; the mb_flags 78 * field permits the provider to indicate what fields are intended for 79 * use. 80 */ 81struct mac_biba { 82 int mb_flags; | 77 * range. Depending on the context, one or both may be used; the mb_flags 78 * field permits the provider to indicate what fields are intended for 79 * use. 80 */ 81struct mac_biba { 82 int mb_flags; |
83 struct mac_biba_element mb_single; | 83 struct mac_biba_element mb_effective; |
84 struct mac_biba_element mb_rangelow, mb_rangehigh; 85}; 86 87/* 88 * Biba compartments bit test/set macros. 89 * The range is 1 to MAC_BIBA_MAX_COMPARTMENTS. 90 */ 91#define MAC_BIBA_BIT_TEST(b, w) \ 92 ((w)[(((b) - 1) >> 3)] & (1 << (((b) - 1) & 7))) 93#define MAC_BIBA_BIT_SET(b, w) \ 94 ((w)[(((b) - 1) >> 3)] |= (1 << (((b) - 1) & 7))) 95#define MAC_BIBA_BIT_SET_EMPTY(set) biba_bit_set_empty(set) 96 97#endif /* !_SYS_SECURITY_MAC_BIBA_H */ | 84 struct mac_biba_element mb_rangelow, mb_rangehigh; 85}; 86 87/* 88 * Biba compartments bit test/set macros. 89 * The range is 1 to MAC_BIBA_MAX_COMPARTMENTS. 90 */ 91#define MAC_BIBA_BIT_TEST(b, w) \ 92 ((w)[(((b) - 1) >> 3)] & (1 << (((b) - 1) & 7))) 93#define MAC_BIBA_BIT_SET(b, w) \ 94 ((w)[(((b) - 1) >> 3)] |= (1 << (((b) - 1) & 7))) 95#define MAC_BIBA_BIT_SET_EMPTY(set) biba_bit_set_empty(set) 96 97#endif /* !_SYS_SECURITY_MAC_BIBA_H */ |