2 * Copyright (c) 1999-2002 Robert N. M. Watson
3 * Copyright (c) 2001 Ilmar S. Habibulin
4 * Copyright (c) 2001-2004 Networks Associates Technology, Inc.
5 * Copyright (c) 2006 SPARTA, Inc.
7 * This software was developed by Robert Watson and Ilmar Habibulin for the
10 * This software was developed for the FreeBSD Project in part by Network
11 * Associates Laboratories, the Security Research Division of Network
12 * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
13 * as part of the DARPA CHATS research program.
15 * This software was enhanced by SPARTA ISSO under SPAWAR contract
16 * N66001-04-C-6019 ("SEFOS").
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 #include <sys/param.h>
43 #include <sys/module.h>
44 #include <sys/vnode.h>
46 #include <security/audit/audit.h>
48 #include <security/mac/mac_framework.h>
49 #include <security/mac/mac_internal.h>
50 #include <security/mac/mac_policy.h>
53 mac_proc_check_setaudit(struct ucred *cred, struct auditinfo *ai)
57 MAC_CHECK(proc_check_setaudit, cred, ai);
63 mac_proc_check_setaudit_addr(struct ucred *cred, struct auditinfo_addr *aia)
67 MAC_CHECK(proc_check_setaudit_addr, cred, aia);
73 mac_proc_check_setauid(struct ucred *cred, uid_t auid)
77 MAC_CHECK(proc_check_setauid, cred, auid);
83 mac_system_check_audit(struct ucred *cred, void *record, int length)
87 MAC_CHECK(system_check_audit, cred, record, length);
93 mac_system_check_auditctl(struct ucred *cred, struct vnode *vp)
98 ASSERT_VOP_LOCKED(vp, "mac_system_check_auditctl");
100 vl = (vp != NULL) ? vp->v_label : NULL;
102 MAC_CHECK(system_check_auditctl, cred, vp, vl);
108 mac_system_check_auditon(struct ucred *cred, int cmd)
112 MAC_CHECK(system_check_auditon, cred, cmd);