freebsd-dev/lib
Pawel Jakub Dawidek 2609222ab4 Merge Capsicum overhaul:
- Capability is no longer separate descriptor type. Now every descriptor
  has set of its own capability rights.

- The cap_new(2) system call is left, but it is no longer documented and
  should not be used in new code.

- The new syscall cap_rights_limit(2) should be used instead of
  cap_new(2), which limits capability rights of the given descriptor
  without creating a new one.

- The cap_getrights(2) syscall is renamed to cap_rights_get(2).

- If CAP_IOCTL capability right is present we can further reduce allowed
  ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed
  ioctls can be retrived with cap_ioctls_get(2) syscall.

- If CAP_FCNTL capability right is present we can further reduce fcntls
  that can be used with the new cap_fcntls_limit(2) syscall and retrive
  them with cap_fcntls_get(2).

- To support ioctl and fcntl white-listing the filedesc structure was
  heavly modified.

- The audit subsystem, kdump and procstat tools were updated to
  recognize new syscalls.

- Capability rights were revised and eventhough I tried hard to provide
  backward API and ABI compatibility there are some incompatible changes
  that are described in detail below:

	CAP_CREATE old behaviour:
	- Allow for openat(2)+O_CREAT.
	- Allow for linkat(2).
	- Allow for symlinkat(2).
	CAP_CREATE new behaviour:
	- Allow for openat(2)+O_CREAT.

	Added CAP_LINKAT:
	- Allow for linkat(2). ABI: Reuses CAP_RMDIR bit.
	- Allow to be target for renameat(2).

	Added CAP_SYMLINKAT:
	- Allow for symlinkat(2).

	Removed CAP_DELETE. Old behaviour:
	- Allow for unlinkat(2) when removing non-directory object.
	- Allow to be source for renameat(2).

	Removed CAP_RMDIR. Old behaviour:
	- Allow for unlinkat(2) when removing directory.

	Added CAP_RENAMEAT:
	- Required for source directory for the renameat(2) syscall.

	Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR):
	- Allow for unlinkat(2) on any object.
	- Required if target of renameat(2) exists and will be removed by this
	  call.

	Removed CAP_MAPEXEC.

	CAP_MMAP old behaviour:
	- Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and
	  PROT_WRITE.
	CAP_MMAP new behaviour:
	- Allow for mmap(2)+PROT_NONE.

	Added CAP_MMAP_R:
	- Allow for mmap(PROT_READ).
	Added CAP_MMAP_W:
	- Allow for mmap(PROT_WRITE).
	Added CAP_MMAP_X:
	- Allow for mmap(PROT_EXEC).
	Added CAP_MMAP_RW:
	- Allow for mmap(PROT_READ | PROT_WRITE).
	Added CAP_MMAP_RX:
	- Allow for mmap(PROT_READ | PROT_EXEC).
	Added CAP_MMAP_WX:
	- Allow for mmap(PROT_WRITE | PROT_EXEC).
	Added CAP_MMAP_RWX:
	- Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC).

	Renamed CAP_MKDIR to CAP_MKDIRAT.
	Renamed CAP_MKFIFO to CAP_MKFIFOAT.
	Renamed CAP_MKNODE to CAP_MKNODEAT.

	CAP_READ old behaviour:
	- Allow pread(2).
	- Disallow read(2), readv(2) (if there is no CAP_SEEK).
	CAP_READ new behaviour:
	- Allow read(2), readv(2).
	- Disallow pread(2) (CAP_SEEK was also required).

	CAP_WRITE old behaviour:
	- Allow pwrite(2).
	- Disallow write(2), writev(2) (if there is no CAP_SEEK).
	CAP_WRITE new behaviour:
	- Allow write(2), writev(2).
	- Disallow pwrite(2) (CAP_SEEK was also required).

	Added convinient defines:

	#define	CAP_PREAD		(CAP_SEEK | CAP_READ)
	#define	CAP_PWRITE		(CAP_SEEK | CAP_WRITE)
	#define	CAP_MMAP_R		(CAP_MMAP | CAP_SEEK | CAP_READ)
	#define	CAP_MMAP_W		(CAP_MMAP | CAP_SEEK | CAP_WRITE)
	#define	CAP_MMAP_X		(CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL)
	#define	CAP_MMAP_RW		(CAP_MMAP_R | CAP_MMAP_W)
	#define	CAP_MMAP_RX		(CAP_MMAP_R | CAP_MMAP_X)
	#define	CAP_MMAP_WX		(CAP_MMAP_W | CAP_MMAP_X)
	#define	CAP_MMAP_RWX		(CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X)
	#define	CAP_RECV		CAP_READ
	#define	CAP_SEND		CAP_WRITE

	#define	CAP_SOCK_CLIENT \
		(CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \
		 CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN)
	#define	CAP_SOCK_SERVER \
		(CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \
		 CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \
		 CAP_SETSOCKOPT | CAP_SHUTDOWN)

	Added defines for backward API compatibility:

	#define	CAP_MAPEXEC		CAP_MMAP_X
	#define	CAP_DELETE		CAP_UNLINKAT
	#define	CAP_MKDIR		CAP_MKDIRAT
	#define	CAP_RMDIR		CAP_UNLINKAT
	#define	CAP_MKFIFO		CAP_MKFIFOAT
	#define	CAP_MKNOD		CAP_MKNODAT
	#define	CAP_SOCK_ALL		(CAP_SOCK_CLIENT | CAP_SOCK_SERVER)

Sponsored by:	The FreeBSD Foundation
Reviewed by:	Christoph Mallon <christoph.mallon@gmx.de>
Many aspects discussed with:	rwatson, benl, jonathan
ABI compatibility discussed with:	kib
2013-03-02 00:53:12 +00:00
..
atf Remove -L<path> from LDADD, it doesn't belong there. 2012-11-07 00:23:51 +00:00
bind Re-disable GSSAPI, which does not build on several archs. 2012-12-07 16:05:04 +00:00
clang Allow us to build clang for ARM EABI. Clang and llvm use the 2013-02-12 05:56:00 +00:00
csu Only assign the environ in the startup code when environ is NULL. 2013-01-07 17:58:27 +00:00
libalias
libarchive Remove several MLINKS that were listed twice. 2013-01-23 23:53:26 +00:00
libauditd
libbegemot
libblocksruntime
libbluetooth General mdoc(7) and typo fixes. 2012-05-11 20:06:46 +00:00
libbsm
libbsnmp Add missing DPADD 2013-01-01 18:29:25 +00:00
libbz2
libc Merge Capsicum overhaul: 2013-03-02 00:53:12 +00:00
libc++ Fix broken macro checking in the libc++ Makefile, introduced in r241909. 2012-11-02 12:18:38 +00:00
libcalendar
libcam Use snprintf(3) constantly when generating CAM error messages. 2012-03-03 09:19:20 +00:00
libcom_err - Update FreeBSD Heimdal distribution to version 1.5.1. This also brings 2012-03-22 08:48:42 +00:00
libcompat
libcompiler_rt Add the __aeabi_mem* functions to compiler-rt as clang uses them. 2013-02-06 00:01:28 +00:00
libcrypt Simple unit-tests for libcrypt, to show how easy it is. 2012-11-07 22:03:59 +00:00
libcxxrt Add several missing symbols to libcxxrt's symbol version map, and remove 2013-02-03 20:40:41 +00:00
libdevinfo
libdevstat New devstat metrics for devstat_compute_statistics(): 2012-12-15 18:19:48 +00:00
libdwarf remove duplicate semicolons where possible. 2012-10-22 03:00:37 +00:00
libedit Add FILES section. 2013-01-12 09:08:37 +00:00
libefi
libelf Merge part of r1712 from elftoolchain, making it possible to resize ELF 2013-02-24 15:15:50 +00:00
libexpat Update base system libexpat to 2.1.0. 2013-02-26 00:58:44 +00:00
libfetch Fix weird indentation. 2012-11-16 12:31:43 +00:00
libgeom Improve libgeom XML parsing error handling. 2012-10-26 12:46:33 +00:00
libgpib mdoc: minor Bl improvements. 2012-06-02 08:47:26 +00:00
libgssapi mdoc: add missing -width argument to Bl -tag. 2012-06-08 12:09:00 +00:00
libiconv Remove redundant assignments to WARNS. 2011-06-06 20:24:17 +00:00
libiconv_modules
libipsec remove redundant yyparse declarations 2012-12-05 20:28:44 +00:00
libipx
libjail Fix some memory allocation errors: 2012-10-04 19:07:05 +00:00
libkiconv no one bothered to write the iconv.9 man page... If it appears we 2013-02-26 19:46:02 +00:00
libkse Fix typo in ".PATH" 2012-04-18 07:02:53 +00:00
libkvm kvm_getprocs: gracefully handle errors from kvm_deadprocs 2012-10-06 20:16:04 +00:00
libldns Upgrade to 1.6.16 2013-02-15 21:49:12 +00:00
liblzma Update xz to git snapshot of v5.0 branch as of 20110711 (post-5.0.3) 2011-07-11 14:15:27 +00:00
libmagic r235638 is not the clean way to add support for building on ancient FreeBSD 2012-09-11 22:38:33 +00:00
libmandoc Merge mandoc from vendor into contrib and provide the necessary Makefile glue. 2012-10-19 22:21:01 +00:00
libmd Remove the RFC 1319 MD2 Message-Digest Algorithm routines from libmd. 2012-04-28 02:48:51 +00:00
libmemstat Const-ify the zone name argument to uma_zcreate(9). 2012-10-26 17:51:05 +00:00
libmilter
libmp Fix whitespace inconsistencies found in homegrown Symbol.maps. 2011-10-07 15:05:24 +00:00
libnandfs Import work done under project/nand (@235533) into head. 2012-05-17 10:11:18 +00:00
libncp Add characters mapping for codepages used in Germany. 2012-06-01 03:59:08 +00:00
libnetbsd Add libnetbsd, a thin compatibility layer intended to allow a limited 2012-12-21 20:37:38 +00:00
libnetgraph Fix socket calls on error post-r243965. 2012-12-21 15:54:13 +00:00
libngatm
libopie X11BASE has been deprecated for a long time and will die soon 2012-01-09 00:48:19 +00:00
libpam remove duplicate semicolons where possible. 2012-10-22 03:00:37 +00:00
libpcap MFV: libpcap 1.3.0. 2012-10-05 18:42:50 +00:00
libpmc Add support for good old 8192Hz profiling clock to software PMC. 2013-02-26 18:13:42 +00:00
libproc - Compute the correct size to reallocate when doubling the size of the 2013-01-28 15:48:31 +00:00
libprocstat Merge Capsicum overhaul: 2013-03-02 00:53:12 +00:00
libradius Fix the bindto parameter declaration. 2013-01-09 19:49:35 +00:00
librpcsec_gss Fix warnings found by -Wmising-variable-declarations. 2012-10-19 05:43:38 +00:00
librpcsvc Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor 2012-02-07 09:27:07 +00:00
librt Register signal 33 explicitly as reserved by real-time library, and 2012-03-26 19:12:09 +00:00
librtld_db Bump shared libraries version numbers in preparation for 9.0. 2011-08-28 09:26:48 +00:00
libsbuf Ok, so we use different comment conventions in Symbol.map and Version.def 2011-05-17 19:20:32 +00:00
libsdp Change the SDP_GET* macros to cast to a const buffer. 2011-10-16 08:45:16 +00:00
libsm Since clang 3.2 now has an option to suppress warnings about implicitly 2013-02-16 20:17:31 +00:00
libsmb
libsmdb
libsmutil
libstand Fix includes for use in libstand. 2013-02-19 17:09:23 +00:00
libstdbuf Remove WARNS=6 lines. 2012-10-18 15:39:29 +00:00
libstdthreads Pull up vendor changes to mdoc(7) 2012-01-05 21:36:12 +00:00
libtacplus General mdoc(7) and typo fixes. 2012-05-11 20:06:46 +00:00
libtelnet - Do not use deprecated krb5 error message reporting functions in libtelnet. 2012-04-06 00:03:45 +00:00
libthr libthr: Always use the threaded rtld lock implementation. 2013-01-18 23:08:40 +00:00
libthread_db Fix warnings found by -Wmising-variable-declarations. 2012-10-19 05:43:38 +00:00
libufs Make berase() work on platforms whose kernel lacks DIOCGDELETE ioctl. 2011-12-08 12:31:47 +00:00
libugidfw
libulog Properly use SHA1_Final() instead of SHA_Final(). 2012-04-19 15:28:15 +00:00
libusb Add USB API to read power draw on USB devices. 2013-02-14 12:22:40 +00:00
libusbhid Restore handling of the third argument (id) of hid_start_parse(), same as 2012-09-20 18:56:27 +00:00
libutil Fixed documented prototype of kinfo_getproc(3). 2013-03-01 07:39:14 +00:00
libvgl Fix various typos in manual pages. 2012-02-25 14:31:25 +00:00
libvmmapi Implement guest vcpu pinning using 'pthread_setaffinity_np(3)'. 2013-02-11 20:36:07 +00:00
libwrap
liby
libypclnt Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor 2012-02-07 09:27:07 +00:00
libz MFV: Update zlib to 1.2.7. 2012-06-21 21:47:08 +00:00
msun Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in 2012-11-10 21:22:10 +00:00
ncurses Only install manpages and html documentation in the ncurses/*w (wchar) 2013-01-24 16:38:47 +00:00
Makefile Import LDNS and build it as an internal library. 2013-02-15 13:44:18 +00:00
Makefile.inc