Name Date Size #Lines LOC

..22-Aug-2023-

.gitignoreH A D22-Aug-2023235 1919

CONTRIBUTING.mdH A D22-Aug-2023880 2115

GNUmakefileH A D22-Aug-20232.3 KiB8354

LICENSEH A D22-Aug-20231.4 KiB2724

README.mdH A D22-Aug-20232.7 KiB6341

capability-fd-pair.ccH A D22-Aug-20235.5 KiB189157

capability-fd.ccH A D22-Aug-202343.5 KiB1,3451,100

capmode.ccH A D22-Aug-202323.7 KiB731582

capsicum-freebsd.hH A D22-Aug-20232 KiB7443

capsicum-linux.hH A D22-Aug-20231.2 KiB4123

capsicum-rights.hH A D22-Aug-20232.9 KiB11993

capsicum-test-main.ccH A D22-Aug-20234.4 KiB161136

capsicum-test.ccH A D22-Aug-20232.8 KiB117102

capsicum-test.hH A D22-Aug-202310.6 KiB282208

capsicum.hH A D22-Aug-20234.5 KiB176122

fcntl.ccH A D22-Aug-202314.5 KiB412303

fexecve.ccH A D22-Aug-20236.1 KiB208167

ioctl.ccH A D22-Aug-20236.9 KiB235177

linux.ccH A D22-Aug-202348.9 KiB1,5011,182

makefileH A D22-Aug-20231.6 KiB3726

mini-me.cH A D22-Aug-20231 KiB3931

mqueue.ccH A D22-Aug-20233.2 KiB10076

openat.ccH A D22-Aug-202314.7 KiB367247

overhead.ccH A D22-Aug-20231.3 KiB4640

procdesc.ccH A D22-Aug-202333.5 KiB1,098814

rename.ccH A D22-Aug-20231.6 KiB5027

sctp.ccH A D22-Aug-20237.1 KiB213176

select.ccH A D22-Aug-20234 KiB143117

showrightsH A D22-Aug-20234.8 KiB10094

smoketest.cH A D22-Aug-20234.9 KiB136103

socket.ccH A D22-Aug-202311.1 KiB351276

syscalls.hH A D22-Aug-20238.4 KiB260189

sysctl.ccH A D22-Aug-2023403 1611

waittest.cH A D22-Aug-20231 KiB4339

README.md

1# Capsicum User Space Tests
2
3This directory holds unit tests for [Capsicum](http://www.cl.cam.ac.uk/research/security/capsicum/)
4object-capabilities. The tests exercise the syscall interface to a Capsicum-enabled operating system,
5currently either [FreeBSD >=10.x](http://www.freebsd.org) or a modified Linux kernel (the
6[capsicum-linux](http://github.com/google/capsicum-linux) project).
7
8The tests are written in C++98, and use the [Google Test](https://code.google.com/p/googletest/)
9framework, with some additions to fork off particular tests (because a process that enters capability
10mode cannot leave it again).
11
12## Provenance
13
14The original basis for these tests was:
15
16 - [unit tests](https://github.com/freebsd/freebsd/tree/master/tools/regression/security/cap_test)
17   written by Robert Watson and Jonathan Anderson for the original FreeBSD 9.x Capsicum implementation
18 - [unit tests](http://git.chromium.org/gitweb/?p=chromiumos/third_party/kernel-capsicum.git;a=tree;f=tools/testing/capsicum_tests;hb=refs/heads/capsicum) written by Meredydd Luff for the original Capsicum-Linux port.
19
20These tests were coalesced and moved into an independent repository to enable
21comparative testing across multiple OSes, and then substantially extended.
22
23## OS Configuration
24
25### Linux
26
27The following kernel configuration options are needed to run the tests:
28
29 - `CONFIG_SECURITY_CAPSICUM`: enable the Capsicum framework
30 - `CONFIG_PROCDESC`: enable Capsicum process-descriptor functionality
31 - `CONFIG_DEBUG_FS`: enable debug filesystem
32 - `CONFIG_IP_SCTP`: enable SCTP support
33
34### FreeBSD (>= 10.x)
35
36The following kernel configuration options are needed so that all tests can run:
37
38  - `options P1003_1B_MQUEUE`: Enable POSIX message queues (or `kldload mqueuefs`)
39
40## Other Dependencies
41
42### Linux
43
44The following additional development packages are needed to build the full test suite on Linux.
45
46 - `libcaprights`: See below
47 - `libcap-dev`: Provides headers for POSIX.1e capabilities.
48 - `libsctp1`: Provides SCTP library functions.
49 - `libsctp-dev`: Provides headers for SCTP library functions.
50
51
52## Linux libcaprights
53
54The Capsicum userspace library is held in the `libcaprights/` subdirectory.  Ideally, this
55library should be built (with `./configure; make` or `dpkg-buildpackage -uc -us`) and
56installed (with `make install` or `dpkg -i libcaprights*.deb`) so that the tests will
57use behave like a normal Capsicum-aware application.
58
59However, if no installed copy of the library is found, the `GNUmakefile` will attempt
60to use the local `libcaprights/*.c` source; this requires `./configure` to have been
61performed in the `libcaprights` subdirectory. The local code is also used for
62cross-compiled builds of the test suite (e.g. `make ARCH=32` or `make ARCH=x32`).
63