Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
|
|
|
|
* Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This software was developed by Robert Watson for the TrustedBSD Project.
|
|
|
|
*
|
2002-11-04 01:42:39 +00:00
|
|
|
* This software was developed for the FreeBSD Project in part by Network
|
|
|
|
* Associates Laboratories, the Security Research Division of Network
|
|
|
|
* Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
|
|
|
|
* as part of the DARPA CHATS research program.
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Userland/kernel interface for Mandatory Access Control.
|
|
|
|
*
|
|
|
|
* The POSIX.1e implementation page may be reached at:
|
|
|
|
* http://www.trustedbsd.org/
|
|
|
|
*/
|
|
|
|
#ifndef _SYS_MAC_H
|
|
|
|
#define _SYS_MAC_H
|
|
|
|
|
2002-08-13 15:54:28 +00:00
|
|
|
#include <sys/_label.h>
|
|
|
|
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
#ifndef _POSIX_MAC
|
|
|
|
#define _POSIX_MAC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXXMAC: The single MAC extended attribute will be deprecated once
|
|
|
|
* compound EA writes on a single target file can be performed cleanly
|
|
|
|
* with UFS2.
|
|
|
|
*/
|
|
|
|
#define FREEBSD_MAC_EXTATTR_NAME "freebsd.mac"
|
|
|
|
#define FREEBSD_MAC_EXTATTR_NAMESPACE EXTATTR_NAMESPACE_SYSTEM
|
|
|
|
|
2002-08-19 17:59:48 +00:00
|
|
|
/*
|
|
|
|
* MAC framework-related constants and limits.
|
|
|
|
*/
|
Revised APIs for user process label management; the existing APIs relied
on all label parsing occuring in userland, and knowledge of the loaded
policies in the user libraries. This revision of the API pushes that
parsing into the kernel, avoiding the need for shared library support
of policies in userland, permitting statically linked binaries (such
as ls, ps, and ifconfig) to use MAC labels. In these API revisions,
high level parsing of the MAC label is done in the MAC Framework,
and interpretation of label elements is delegated to the MAC policy
modules. This permits modules to export zero or more label elements
to user space if desired, and support them in the manner they want
and with the semantics they want. This is believed to be the final
revision of this interface: from the perspective of user applications,
the API has actually not changed, although the ABI has.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-22 14:27:44 +00:00
|
|
|
#define MAC_MAX_POLICY_NAME 32
|
|
|
|
#define MAC_MAX_LABEL_ELEMENT_NAME 32
|
|
|
|
#define MAC_MAX_LABEL_ELEMENT_DATA 4096
|
|
|
|
#define MAC_MAX_LABEL_BUF_LEN 8192
|
|
|
|
|
|
|
|
struct mac {
|
|
|
|
size_t m_buflen;
|
|
|
|
char *m_string;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct mac *mac_t;
|
|
|
|
|
|
|
|
#ifndef _KERNEL
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Location of the userland MAC framework configuration file. mac.conf
|
|
|
|
* binds policy names to shared libraries that understand those policies,
|
|
|
|
* as well as setting defaults for MAC-aware applications.
|
|
|
|
*/
|
|
|
|
#define MAC_CONFFILE "/etc/mac.conf"
|
2002-08-19 17:59:48 +00:00
|
|
|
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
/*
|
Revised APIs for user process label management; the existing APIs relied
on all label parsing occuring in userland, and knowledge of the loaded
policies in the user libraries. This revision of the API pushes that
parsing into the kernel, avoiding the need for shared library support
of policies in userland, permitting statically linked binaries (such
as ls, ps, and ifconfig) to use MAC labels. In these API revisions,
high level parsing of the MAC label is done in the MAC Framework,
and interpretation of label elements is delegated to the MAC policy
modules. This permits modules to export zero or more label elements
to user space if desired, and support them in the manner they want
and with the semantics they want. This is believed to be the final
revision of this interface: from the perspective of user applications,
the API has actually not changed, although the ABI has.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-22 14:27:44 +00:00
|
|
|
* Extended non-POSIX.1e interfaces that offer additional services
|
|
|
|
* available from the userland and kernel MAC frameworks.
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
*/
|
Revised APIs for user process label management; the existing APIs relied
on all label parsing occuring in userland, and knowledge of the loaded
policies in the user libraries. This revision of the API pushes that
parsing into the kernel, avoiding the need for shared library support
of policies in userland, permitting statically linked binaries (such
as ls, ps, and ifconfig) to use MAC labels. In these API revisions,
high level parsing of the MAC label is done in the MAC Framework,
and interpretation of label elements is delegated to the MAC policy
modules. This permits modules to export zero or more label elements
to user space if desired, and support them in the manner they want
and with the semantics they want. This is believed to be the final
revision of this interface: from the perspective of user applications,
the API has actually not changed, although the ABI has.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-22 14:27:44 +00:00
|
|
|
int mac_free(mac_t _label);
|
|
|
|
int mac_from_text(mac_t *_label, const char *_text);
|
|
|
|
int mac_get_fd(int _fd, mac_t _label);
|
|
|
|
int mac_get_file(const char *_path, mac_t _label);
|
|
|
|
int mac_get_link(const char *_path, mac_t _label);
|
|
|
|
int mac_get_pid(pid_t _pid, mac_t _label);
|
|
|
|
int mac_get_proc(mac_t _label);
|
|
|
|
int mac_is_present(const char *_policyname);
|
|
|
|
int mac_prepare(mac_t *_label, char *_elements);
|
|
|
|
int mac_prepare_file_label(mac_t *_label);
|
|
|
|
int mac_prepare_ifnet_label(mac_t *_label);
|
|
|
|
int mac_prepare_process_label(mac_t *_label);
|
|
|
|
int mac_set_fd(int _fildes, const mac_t _label);
|
|
|
|
int mac_set_file(const char *_path, mac_t _label);
|
|
|
|
int mac_set_link(const char *_path, mac_t _label);
|
|
|
|
int mac_set_proc(const mac_t _label);
|
|
|
|
int mac_syscall(const char *_policyname, int _call, void *_arg);
|
|
|
|
int mac_to_text(mac_t mac, char **_text);
|
|
|
|
|
2002-10-28 19:44:05 +00:00
|
|
|
#else /* _KERNEL */
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Kernel functions to manage and evaluate labels.
|
|
|
|
*/
|
|
|
|
struct bpf_d;
|
|
|
|
struct componentname;
|
|
|
|
struct devfs_dirent;
|
|
|
|
struct ifnet;
|
|
|
|
struct ifreq;
|
|
|
|
struct ipq;
|
|
|
|
struct mbuf;
|
|
|
|
struct mount;
|
|
|
|
struct proc;
|
|
|
|
struct sockaddr;
|
|
|
|
struct socket;
|
|
|
|
struct pipe;
|
2002-10-02 02:42:38 +00:00
|
|
|
struct thread;
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
struct timespec;
|
|
|
|
struct ucred;
|
|
|
|
struct uio;
|
|
|
|
struct vattr;
|
|
|
|
struct vnode;
|
|
|
|
|
|
|
|
#include <sys/acl.h> /* XXX acl_type_t */
|
|
|
|
|
|
|
|
struct vop_refreshlabel_args;
|
|
|
|
struct vop_setlabel_args;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Label operations.
|
|
|
|
*/
|
|
|
|
void mac_init_bpfdesc(struct bpf_d *);
|
|
|
|
void mac_init_cred(struct ucred *);
|
|
|
|
void mac_init_devfsdirent(struct devfs_dirent *);
|
|
|
|
void mac_init_ifnet(struct ifnet *);
|
|
|
|
void mac_init_ipq(struct ipq *);
|
2002-10-05 21:23:47 +00:00
|
|
|
int mac_init_socket(struct socket *, int flag);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
void mac_init_pipe(struct pipe *);
|
2002-10-05 21:23:47 +00:00
|
|
|
int mac_init_mbuf(struct mbuf *m, int flag);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
void mac_init_mount(struct mount *);
|
|
|
|
void mac_init_vnode(struct vnode *);
|
Slightly change the semantics of vnode labels for MAC: rather than
"refreshing" the label on the vnode before use, just get the label
right from inception. For single-label file systems, set the label
in the generic VFS getnewvnode() code; for multi-label file systems,
leave the labeling up to the file system. With UFS1/2, this means
reading the extended attribute during vfs_vget() as the inode is
pulled off disk, rather than hitting the extended attributes
frequently during operations later, improving performance. This
also corrects sematics for shared vnode locks, which were not
previously present in the system. This chances the cache
coherrency properties WRT out-of-band access to label data, but in
an acceptable form. With UFS1, there is a small race condition
during automatic extended attribute start -- this is not present
with UFS2, and occurs because EAs aren't available at vnode
inception. We'll introduce a work around for this shortly.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-26 14:38:24 +00:00
|
|
|
void mac_init_vnode_label(struct label *);
|
|
|
|
void mac_copy_vnode_label(struct label *, struct label *label);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
void mac_destroy_bpfdesc(struct bpf_d *);
|
|
|
|
void mac_destroy_cred(struct ucred *);
|
|
|
|
void mac_destroy_devfsdirent(struct devfs_dirent *);
|
|
|
|
void mac_destroy_ifnet(struct ifnet *);
|
|
|
|
void mac_destroy_ipq(struct ipq *);
|
|
|
|
void mac_destroy_socket(struct socket *);
|
|
|
|
void mac_destroy_pipe(struct pipe *);
|
|
|
|
void mac_destroy_mbuf(struct mbuf *);
|
|
|
|
void mac_destroy_mount(struct mount *);
|
|
|
|
void mac_destroy_vnode(struct vnode *);
|
Slightly change the semantics of vnode labels for MAC: rather than
"refreshing" the label on the vnode before use, just get the label
right from inception. For single-label file systems, set the label
in the generic VFS getnewvnode() code; for multi-label file systems,
leave the labeling up to the file system. With UFS1/2, this means
reading the extended attribute during vfs_vget() as the inode is
pulled off disk, rather than hitting the extended attributes
frequently during operations later, improving performance. This
also corrects sematics for shared vnode locks, which were not
previously present in the system. This chances the cache
coherrency properties WRT out-of-band access to label data, but in
an acceptable form. With UFS1, there is a small race condition
during automatic extended attribute start -- this is not present
with UFS2, and occurs because EAs aren't available at vnode
inception. We'll introduce a work around for this shortly.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-26 14:38:24 +00:00
|
|
|
void mac_destroy_vnode_label(struct label *);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Labeling event operations: file system objects, and things that
|
|
|
|
* look a lot like file system objects.
|
|
|
|
*/
|
Slightly change the semantics of vnode labels for MAC: rather than
"refreshing" the label on the vnode before use, just get the label
right from inception. For single-label file systems, set the label
in the generic VFS getnewvnode() code; for multi-label file systems,
leave the labeling up to the file system. With UFS1/2, this means
reading the extended attribute during vfs_vget() as the inode is
pulled off disk, rather than hitting the extended attributes
frequently during operations later, improving performance. This
also corrects sematics for shared vnode locks, which were not
previously present in the system. This chances the cache
coherrency properties WRT out-of-band access to label data, but in
an acceptable form. With UFS1, there is a small race condition
during automatic extended attribute start -- this is not present
with UFS2, and occurs because EAs aren't available at vnode
inception. We'll introduce a work around for this shortly.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-26 14:38:24 +00:00
|
|
|
void mac_associate_vnode_devfs(struct mount *mp, struct devfs_dirent *de,
|
|
|
|
struct vnode *vp);
|
|
|
|
int mac_associate_vnode_extattr(struct mount *mp, struct vnode *vp);
|
|
|
|
void mac_associate_vnode_singlelabel(struct mount *mp, struct vnode *vp);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
void mac_create_devfs_device(dev_t dev, struct devfs_dirent *de);
|
|
|
|
void mac_create_devfs_directory(char *dirname, int dirnamelen,
|
|
|
|
struct devfs_dirent *de);
|
2002-10-05 18:40:10 +00:00
|
|
|
void mac_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
|
|
|
|
struct devfs_dirent *de);
|
Revised APIs for user process label management; the existing APIs relied
on all label parsing occuring in userland, and knowledge of the loaded
policies in the user libraries. This revision of the API pushes that
parsing into the kernel, avoiding the need for shared library support
of policies in userland, permitting statically linked binaries (such
as ls, ps, and ifconfig) to use MAC labels. In these API revisions,
high level parsing of the MAC label is done in the MAC Framework,
and interpretation of label elements is delegated to the MAC policy
modules. This permits modules to export zero or more label elements
to user space if desired, and support them in the manner they want
and with the semantics they want. This is believed to be the final
revision of this interface: from the perspective of user applications,
the API has actually not changed, although the ABI has.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-22 14:27:44 +00:00
|
|
|
void mac_create_devfs_vnode(struct devfs_dirent *de, struct vnode *vp);
|
Slightly change the semantics of vnode labels for MAC: rather than
"refreshing" the label on the vnode before use, just get the label
right from inception. For single-label file systems, set the label
in the generic VFS getnewvnode() code; for multi-label file systems,
leave the labeling up to the file system. With UFS1/2, this means
reading the extended attribute during vfs_vget() as the inode is
pulled off disk, rather than hitting the extended attributes
frequently during operations later, improving performance. This
also corrects sematics for shared vnode locks, which were not
previously present in the system. This chances the cache
coherrency properties WRT out-of-band access to label data, but in
an acceptable form. With UFS1, there is a small race condition
during automatic extended attribute start -- this is not present
with UFS2, and occurs because EAs aren't available at vnode
inception. We'll introduce a work around for this shortly.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2002-10-26 14:38:24 +00:00
|
|
|
int mac_create_vnode_extattr(struct ucred *cred, struct mount *mp,
|
|
|
|
struct vnode *dvp, struct vnode *vp, struct componentname *cnp);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
void mac_create_mount(struct ucred *cred, struct mount *mp);
|
|
|
|
void mac_create_root_mount(struct ucred *cred, struct mount *mp);
|
|
|
|
void mac_relabel_vnode(struct ucred *cred, struct vnode *vp,
|
|
|
|
struct label *newlabel);
|
|
|
|
void mac_update_devfsdirent(struct devfs_dirent *de, struct vnode *vp);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Labeling event operations: IPC objects.
|
|
|
|
*/
|
|
|
|
void mac_create_mbuf_from_socket(struct socket *so, struct mbuf *m);
|
|
|
|
void mac_create_socket(struct ucred *cred, struct socket *socket);
|
|
|
|
void mac_create_socket_from_socket(struct socket *oldsocket,
|
|
|
|
struct socket *newsocket);
|
|
|
|
void mac_set_socket_peer_from_mbuf(struct mbuf *mbuf,
|
|
|
|
struct socket *socket);
|
|
|
|
void mac_set_socket_peer_from_socket(struct socket *oldsocket,
|
|
|
|
struct socket *newsocket);
|
|
|
|
void mac_create_pipe(struct ucred *cred, struct pipe *pipe);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Labeling event operations: network objects.
|
|
|
|
*/
|
|
|
|
void mac_create_bpfdesc(struct ucred *cred, struct bpf_d *bpf_d);
|
|
|
|
void mac_create_ifnet(struct ifnet *ifp);
|
|
|
|
void mac_create_ipq(struct mbuf *fragment, struct ipq *ipq);
|
|
|
|
void mac_create_datagram_from_ipq(struct ipq *ipq, struct mbuf *datagram);
|
|
|
|
void mac_create_fragment(struct mbuf *datagram, struct mbuf *fragment);
|
|
|
|
void mac_create_mbuf_from_mbuf(struct mbuf *oldmbuf, struct mbuf *newmbuf);
|
|
|
|
void mac_create_mbuf_linklayer(struct ifnet *ifnet, struct mbuf *m);
|
|
|
|
void mac_create_mbuf_from_bpfdesc(struct bpf_d *bpf_d, struct mbuf *m);
|
|
|
|
void mac_create_mbuf_from_ifnet(struct ifnet *ifnet, struct mbuf *m);
|
|
|
|
void mac_create_mbuf_multicast_encap(struct mbuf *oldmbuf,
|
|
|
|
struct ifnet *ifnet, struct mbuf *newmbuf);
|
|
|
|
void mac_create_mbuf_netlayer(struct mbuf *oldmbuf, struct mbuf *newmbuf);
|
|
|
|
int mac_fragment_match(struct mbuf *fragment, struct ipq *ipq);
|
|
|
|
void mac_update_ipq(struct mbuf *fragment, struct ipq *ipq);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Labeling event operations: processes.
|
|
|
|
*/
|
|
|
|
void mac_create_cred(struct ucred *cred_parent, struct ucred *cred_child);
|
|
|
|
void mac_execve_transition(struct ucred *old, struct ucred *new,
|
|
|
|
struct vnode *vp);
|
|
|
|
int mac_execve_will_transition(struct ucred *old, struct vnode *vp);
|
|
|
|
void mac_create_proc0(struct ucred *cred);
|
|
|
|
void mac_create_proc1(struct ucred *cred);
|
2002-10-02 02:42:38 +00:00
|
|
|
void mac_thread_userret(struct thread *td);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
|
|
|
|
/* Access control checks. */
|
|
|
|
int mac_check_bpfdesc_receive(struct bpf_d *bpf_d, struct ifnet *ifnet);
|
|
|
|
int mac_check_cred_visible(struct ucred *u1, struct ucred *u2);
|
|
|
|
int mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *m);
|
2002-11-01 20:46:53 +00:00
|
|
|
int mac_check_kenv_dump(struct ucred *cred);
|
|
|
|
int mac_check_kenv_get(struct ucred *cred, char *name);
|
|
|
|
int mac_check_kenv_set(struct ucred *cred, char *name, char *value);
|
|
|
|
int mac_check_kenv_unset(struct ucred *cred, char *name);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_mount_stat(struct ucred *cred, struct mount *mp);
|
|
|
|
int mac_check_pipe_ioctl(struct ucred *cred, struct pipe *pipe,
|
|
|
|
unsigned long cmd, void *data);
|
2002-08-19 16:59:37 +00:00
|
|
|
int mac_check_pipe_poll(struct ucred *cred, struct pipe *pipe);
|
|
|
|
int mac_check_pipe_read(struct ucred *cred, struct pipe *pipe);
|
|
|
|
int mac_check_pipe_stat(struct ucred *cred, struct pipe *pipe);
|
|
|
|
int mac_check_pipe_write(struct ucred *cred, struct pipe *pipe);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_proc_debug(struct ucred *cred, struct proc *proc);
|
|
|
|
int mac_check_proc_sched(struct ucred *cred, struct proc *proc);
|
|
|
|
int mac_check_proc_signal(struct ucred *cred, struct proc *proc,
|
|
|
|
int signum);
|
|
|
|
int mac_check_socket_bind(struct ucred *cred, struct socket *so,
|
|
|
|
struct sockaddr *sockaddr);
|
|
|
|
int mac_check_socket_connect(struct ucred *cred, struct socket *so,
|
|
|
|
struct sockaddr *sockaddr);
|
2002-08-15 18:51:27 +00:00
|
|
|
int mac_check_socket_deliver(struct socket *so, struct mbuf *m);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_socket_listen(struct ucred *cred, struct socket *so);
|
2002-10-06 14:39:15 +00:00
|
|
|
int mac_check_socket_receive(struct ucred *cred, struct socket *so);
|
|
|
|
int mac_check_socket_send(struct ucred *cred, struct socket *so);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_socket_visible(struct ucred *cred, struct socket *so);
|
2002-11-04 15:13:36 +00:00
|
|
|
int mac_check_system_acct(struct ucred *cred, struct vnode *vp);
|
|
|
|
int mac_check_system_nfsd(struct ucred *cred);
|
2002-10-27 07:03:29 +00:00
|
|
|
int mac_check_system_reboot(struct ucred *cred, int howto);
|
2002-11-03 02:39:42 +00:00
|
|
|
int mac_check_system_settime(struct ucred *cred);
|
2002-10-27 06:54:06 +00:00
|
|
|
int mac_check_system_swapon(struct ucred *cred, struct vnode *vp);
|
2002-10-27 07:12:34 +00:00
|
|
|
int mac_check_system_sysctl(struct ucred *cred, int *name,
|
|
|
|
u_int namelen, void *old, size_t *oldlenp, int inkernel,
|
|
|
|
void *new, size_t newlen);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_vnode_access(struct ucred *cred, struct vnode *vp,
|
2002-10-30 17:56:57 +00:00
|
|
|
int acc_mode);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_vnode_chdir(struct ucred *cred, struct vnode *dvp);
|
|
|
|
int mac_check_vnode_chroot(struct ucred *cred, struct vnode *dvp);
|
|
|
|
int mac_check_vnode_create(struct ucred *cred, struct vnode *dvp,
|
|
|
|
struct componentname *cnp, struct vattr *vap);
|
|
|
|
int mac_check_vnode_delete(struct ucred *cred, struct vnode *dvp,
|
|
|
|
struct vnode *vp, struct componentname *cnp);
|
|
|
|
int mac_check_vnode_deleteacl(struct ucred *cred, struct vnode *vp,
|
|
|
|
acl_type_t type);
|
|
|
|
int mac_check_vnode_exec(struct ucred *cred, struct vnode *vp);
|
|
|
|
int mac_check_vnode_getacl(struct ucred *cred, struct vnode *vp,
|
|
|
|
acl_type_t type);
|
|
|
|
int mac_check_vnode_getextattr(struct ucred *cred, struct vnode *vp,
|
|
|
|
int attrnamespace, const char *name, struct uio *uio);
|
2002-10-05 18:11:36 +00:00
|
|
|
int mac_check_vnode_link(struct ucred *cred, struct vnode *dvp,
|
|
|
|
struct vnode *vp, struct componentname *cnp);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_vnode_lookup(struct ucred *cred, struct vnode *dvp,
|
|
|
|
struct componentname *cnp);
|
2002-10-06 02:46:26 +00:00
|
|
|
int mac_check_vnode_mmap(struct ucred *cred, struct vnode *vp,
|
|
|
|
int prot);
|
|
|
|
int mac_check_vnode_mprotect(struct ucred *cred, struct vnode *vp,
|
|
|
|
int prot);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_vnode_open(struct ucred *cred, struct vnode *vp,
|
2002-10-30 17:56:57 +00:00
|
|
|
int acc_mode);
|
2002-08-19 19:04:53 +00:00
|
|
|
int mac_check_vnode_poll(struct ucred *active_cred,
|
|
|
|
struct ucred *file_cred, struct vnode *vp);
|
|
|
|
int mac_check_vnode_read(struct ucred *active_cred,
|
|
|
|
struct ucred *file_cred, struct vnode *vp);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_check_vnode_readdir(struct ucred *cred, struct vnode *vp);
|
|
|
|
int mac_check_vnode_readlink(struct ucred *cred, struct vnode *vp);
|
|
|
|
int mac_check_vnode_rename_from(struct ucred *cred, struct vnode *dvp,
|
|
|
|
struct vnode *vp, struct componentname *cnp);
|
|
|
|
int mac_check_vnode_rename_to(struct ucred *cred, struct vnode *dvp,
|
|
|
|
struct vnode *vp, int samedir, struct componentname *cnp);
|
|
|
|
int mac_check_vnode_revoke(struct ucred *cred, struct vnode *vp);
|
|
|
|
int mac_check_vnode_setacl(struct ucred *cred, struct vnode *vp,
|
|
|
|
acl_type_t type, struct acl *acl);
|
|
|
|
int mac_check_vnode_setextattr(struct ucred *cred, struct vnode *vp,
|
|
|
|
int attrnamespace, const char *name, struct uio *uio);
|
|
|
|
int mac_check_vnode_setflags(struct ucred *cred, struct vnode *vp,
|
|
|
|
u_long flags);
|
|
|
|
int mac_check_vnode_setmode(struct ucred *cred, struct vnode *vp,
|
|
|
|
mode_t mode);
|
|
|
|
int mac_check_vnode_setowner(struct ucred *cred, struct vnode *vp,
|
|
|
|
uid_t uid, gid_t gid);
|
|
|
|
int mac_check_vnode_setutimes(struct ucred *cred, struct vnode *vp,
|
|
|
|
struct timespec atime, struct timespec mtime);
|
2002-08-19 19:04:53 +00:00
|
|
|
int mac_check_vnode_stat(struct ucred *active_cred,
|
|
|
|
struct ucred *file_cred, struct vnode *vp);
|
|
|
|
int mac_check_vnode_write(struct ucred *active_cred,
|
|
|
|
struct ucred *file_cred, struct vnode *vp);
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
int mac_getsockopt_label_get(struct ucred *cred, struct socket *so,
|
|
|
|
struct mac *extmac);
|
|
|
|
int mac_getsockopt_peerlabel_get(struct ucred *cred, struct socket *so,
|
|
|
|
struct mac *extmac);
|
|
|
|
int mac_ioctl_ifnet_get(struct ucred *cred, struct ifreq *ifr,
|
|
|
|
struct ifnet *ifnet);
|
|
|
|
int mac_ioctl_ifnet_set(struct ucred *cred, struct ifreq *ifr,
|
|
|
|
struct ifnet *ifnet);
|
|
|
|
int mac_setsockopt_label_set(struct ucred *cred, struct socket *so,
|
|
|
|
struct mac *extmac);
|
|
|
|
int mac_pipe_label_set(struct ucred *cred, struct pipe *pipe,
|
|
|
|
struct label *label);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Calls to help various file systems implement labeling functionality
|
|
|
|
* using their existing EA implementation.
|
|
|
|
*/
|
|
|
|
int vop_stdsetlabel_ea(struct vop_setlabel_args *ap);
|
|
|
|
|
2002-10-28 19:44:05 +00:00
|
|
|
#endif /* !_KERNEL */
|
Begin committing support for Mandatory Access Control and extensible
kernel access control. The MAC framework permits loadable kernel
modules to link to the kernel at compile-time, boot-time, or run-time,
and augment the system security policy. This commit includes the
initial kernel implementation, although the interface with the userland
components of the oeprating system is still under work, and not all
kernel subsystems are supported. Later in this commit sequence,
documentation of which kernel subsystems will not work correctly with
a kernel compiled with MAC support will be added.
Include files to declare MAC userland interface (mac.h), MAC subsystem
entry points (mac.h), and MAC policy entry points (mac_policy.h). These
files define the interface between the kernel and the MAC framework,
and between the MAC framework and each registered policy module. These
APIs and ABIs may not be assumed to be stable until following FreeBSD
5.1-RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
2002-07-30 21:32:34 +00:00
|
|
|
|
|
|
|
#endif /* !_SYS_MAC_H */
|