diff options
author | rwatson <rwatson@FreeBSD.org> | 2003-11-16 23:31:45 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2003-11-16 23:31:45 +0000 |
commit | 7aa5c2497a67b36cc05ec3c76dca0423b69c9400 (patch) | |
tree | fede3115e7ef270fd4883e1c4206febe55c2efa7 /sys/security/mac_stub/mac_stub.c | |
parent | 44e24b4739d0c28d3ffa69afb7e63d3229969a27 (diff) | |
download | FreeBSD-src-7aa5c2497a67b36cc05ec3c76dca0423b69c9400.zip FreeBSD-src-7aa5c2497a67b36cc05ec3c76dca0423b69c9400.tar.gz |
Implement sockets support for __mac_get_fd() and __mac_set_fd()
system calls, and prefer these calls over getsockopt()/setsockopt()
for ABI reasons. When addressing UNIX domain sockets, these calls
retrieve and modify the socket label, not the label of the
rendezvous vnode.
- Create mac_copy_socket_label() entry point based on
mac_copy_pipe_label() entry point, intended to copy the socket
label into temporary storage that doesn't require a socket lock
to be held (currently Giant).
- Implement mac_copy_socket_label() for various policies.
- Expose socket label allocation, free, internalize, externalize
entry points as non-static from mac_net.c.
- Use mac_socket_label_set() in __mac_set_fd().
MAC-aware applications may now use mac_get_fd(), mac_set_fd(), and
mac_get_peer() to retrieve and set various socket labels without
directly invoking the getsockopt() interface.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/security/mac_stub/mac_stub.c')
-rw-r--r-- | sys/security/mac_stub/mac_stub.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c index a0c7d95..1d48210 100644 --- a/sys/security/mac_stub/mac_stub.c +++ b/sys/security/mac_stub/mac_stub.c @@ -1032,6 +1032,7 @@ static struct mac_policy_ops mac_stub_ops = .mpo_destroy_vnode_label = stub_destroy_label, .mpo_copy_mbuf_label = stub_copy_label, .mpo_copy_pipe_label = stub_copy_label, + .mpo_copy_socket_label = stub_copy_label, .mpo_copy_vnode_label = stub_copy_label, .mpo_externalize_cred_label = stub_externalize_label, .mpo_externalize_ifnet_label = stub_externalize_label, |