freebsd-dev/sys/security/mac
John Baldwin 8e38aeff17 Add a new file descriptor type for IPC shared memory objects and use it to
implement shm_open(2) and shm_unlink(2) in the kernel:
- Each shared memory file descriptor is associated with a swap-backed vm
  object which provides the backing store.  Each descriptor starts off with
  a size of zero, but the size can be altered via ftruncate(2).  The shared
  memory file descriptors also support fstat(2).  read(2), write(2),
  ioctl(2), select(2), poll(2), and kevent(2) are not supported on shared
  memory file descriptors.
- shm_open(2) and shm_unlink(2) are now implemented as system calls that
  manage shared memory file descriptors.  The virtual namespace that maps
  pathnames to shared memory file descriptors is implemented as a hash
  table where the hash key is generated via the 32-bit Fowler/Noll/Vo hash
  of the pathname.
- As an extension, the constant 'SHM_ANON' may be specified in place of the
  path argument to shm_open(2).  In this case, an unnamed shared memory
  file descriptor will be created similar to the IPC_PRIVATE key for
  shmget(2).  Note that the shared memory object can still be shared among
  processes by sharing the file descriptor via fork(2) or sendmsg(2), but
  it is unnamed.  This effectively serves to implement the getmemfd() idea
  bandied about the lists several times over the years.
- The backing store for shared memory file descriptors are garbage
  collected when they are not referenced by any open file descriptors or
  the shm_open(2) virtual namespace.

Submitted by:	dillon, peter (previous versions)
Submitted by:	rwatson (I based this on his version)
Reviewed by:	alc (suggested converting getmemfd() to shm_open())
2008-01-08 21:58:16 +00:00
..
mac_atalk.c Move towards more explicit support for various network protocol stacks 2007-10-28 15:55:23 +00:00
mac_audit.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_framework.c Remove conditional return of 1. For the MAC_STATIC case at this point in 2007-01-01 01:40:29 +00:00
mac_framework.h Add a new file descriptor type for IPC shared memory objects and use it to 2008-01-08 21:58:16 +00:00
mac_inet6.c Move towards more explicit support for various network protocol stacks 2007-10-28 15:55:23 +00:00
mac_inet.c Continue to move from generic network entry points in the TrustedBSD MAC 2007-10-28 17:12:48 +00:00
mac_internal.h Move towards more explicit support for various network protocol stacks 2007-10-28 15:55:23 +00:00
mac_label.c Introduce accessor functions mac_label_get() and mac_label_set() to replace 2007-02-06 14:19:25 +00:00
mac_net.c Garbage collect mac_mbuf_create_multicast_encap TrustedBSD MAC Framework 2007-10-28 17:55:57 +00:00
mac_pipe.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_policy.h Add a new file descriptor type for IPC shared memory objects and use it to 2008-01-08 21:58:16 +00:00
mac_posix_sem.c Fix a MAC label leak for POSIX semaphores, in which per-policy labels 2007-12-17 17:26:32 +00:00
mac_posix_shm.c Add a new file descriptor type for IPC shared memory objects and use it to 2008-01-08 21:58:16 +00:00
mac_priv.c Move src/sys/sys/mac_policy.h, the kernel interface between the MAC 2006-12-22 23:34:47 +00:00
mac_process.c Rename mac_associate_nfsd_label() to mac_proc_associate_nfsd(), and move 2007-10-25 12:34:14 +00:00
mac_socket.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_syscalls.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_system.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_sysv_msg.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_sysv_sem.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_sysv_shm.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
mac_vfs.c Rename mac_associate_nfsd_label() to mac_proc_associate_nfsd(), and move 2007-10-25 12:34:14 +00:00