Deleted Added
full compact
mac_partition.c (106393) mac_partition.c (106648)
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 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

--- 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, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 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

--- 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_partition/mac_partition.c 106393 2002-11-04 01:53:12Z rwatson $
34 * $FreeBSD: head/sys/security/mac_partition/mac_partition.c 106648 2002-11-08 18:04:36Z rwatson $
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 * Experiment with a partition-like model.
40 */
41
42#include <sys/types.h>

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

239{
240 int error;
241
242 error = label_on_label(&cred->cr_label, socketlabel);
243
244 return (error ? ENOENT : 0);
245}
246
35 */
36
37/*
38 * Developed by the TrustedBSD Project.
39 * Experiment with a partition-like model.
40 */
41
42#include <sys/types.h>

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

239{
240 int error;
241
242 error = label_on_label(&cred->cr_label, socketlabel);
243
244 return (error ? ENOENT : 0);
245}
246
247static int
248mac_partition_check_vnode_exec(struct ucred *cred, struct vnode *vp,
249 struct label *label, struct image_params *imgp, struct label *execlabel)
250{
251
252 if (execlabel != NULL) {
253 /*
254 * We currently don't permit labels to be changed at
255 * exec-time as part of the partition model, so disallow
256 * non-NULL partition label changes in execlabel.
257 */
258 if (SLOT(execlabel) != 0)
259 return (EINVAL);
260 }
261
262 return (0);
263}
264
247static struct mac_policy_ops mac_partition_ops =
248{
249 .mpo_init = mac_partition_init,
250 .mpo_init_cred_label = mac_partition_init_label,
251 .mpo_destroy_cred_label = mac_partition_destroy_label,
252 .mpo_externalize_cred_label = mac_partition_externalize_label,
253 .mpo_internalize_cred_label = mac_partition_internalize_label,
254 .mpo_create_cred = mac_partition_create_cred,
255 .mpo_create_proc0 = mac_partition_create_proc0,
256 .mpo_create_proc1 = mac_partition_create_proc1,
257 .mpo_relabel_cred = mac_partition_relabel_cred,
258 .mpo_check_cred_relabel = mac_partition_check_cred_relabel,
259 .mpo_check_cred_visible = mac_partition_check_cred_visible,
260 .mpo_check_proc_debug = mac_partition_check_proc_debug,
261 .mpo_check_proc_sched = mac_partition_check_proc_sched,
262 .mpo_check_proc_signal = mac_partition_check_proc_signal,
263 .mpo_check_socket_visible = mac_partition_check_socket_visible,
265static struct mac_policy_ops mac_partition_ops =
266{
267 .mpo_init = mac_partition_init,
268 .mpo_init_cred_label = mac_partition_init_label,
269 .mpo_destroy_cred_label = mac_partition_destroy_label,
270 .mpo_externalize_cred_label = mac_partition_externalize_label,
271 .mpo_internalize_cred_label = mac_partition_internalize_label,
272 .mpo_create_cred = mac_partition_create_cred,
273 .mpo_create_proc0 = mac_partition_create_proc0,
274 .mpo_create_proc1 = mac_partition_create_proc1,
275 .mpo_relabel_cred = mac_partition_relabel_cred,
276 .mpo_check_cred_relabel = mac_partition_check_cred_relabel,
277 .mpo_check_cred_visible = mac_partition_check_cred_visible,
278 .mpo_check_proc_debug = mac_partition_check_proc_debug,
279 .mpo_check_proc_sched = mac_partition_check_proc_sched,
280 .mpo_check_proc_signal = mac_partition_check_proc_signal,
281 .mpo_check_socket_visible = mac_partition_check_socket_visible,
282 .mpo_check_vnode_exec = mac_partition_check_vnode_exec,
264};
265
266MAC_POLICY_SET(&mac_partition_ops, trustedbsd_mac_partition,
267 "TrustedBSD MAC/Partition", MPC_LOADTIME_FLAG_UNLOADOK, &partition_slot);
283};
284
285MAC_POLICY_SET(&mac_partition_ops, trustedbsd_mac_partition,
286 "TrustedBSD MAC/Partition", MPC_LOADTIME_FLAG_UNLOADOK, &partition_slot);