Paul Wankadia bb6ae1d4ab Introduce AllowRestartableSequencesWithProcFiles() and tidy up.
1. In many cases, sandboxes need to allow /proc/stat and /proc/cpuinfo so that
get_nprocs(3) will work; otherwise, per-CPU logic can't determine how many CPUs
there are. Unfortunately, some of those sandboxes also disable namespaces. The
solution is to provide two functions: AllowRestartableSequencesWithProcFiles(),
which allows syscalls and files; and AllowRestartableSequences(), which allows
syscalls only. Sandboxes should usually call the former; sandboxes that disable
namespaces should instead call the latter and are responsible for allowing the
files via the deprecated Fs mechanism.

2. Make the mmap(2) policy evaluate prot AND flags, not prot OR flags.

3. Order the code and the comments identically for better readability.

PiperOrigin-RevId: 386414028
Change-Id: I016b1854ed1da9c9bcff7b351c5e0041093b8193
2021-07-23 02:23:22 -07:00
..
2021-02-19 04:43:14 -08:00
2020-10-01 06:45:38 -07:00
2020-10-01 06:45:38 -07:00
2021-05-18 05:48:54 -07:00
2021-05-10 07:04:04 -07:00
2020-10-05 05:10:16 -07:00
2020-01-31 05:39:25 -08:00
2021-01-22 06:01:34 -08:00
2021-02-19 04:43:14 -08:00
2021-01-22 06:01:34 -08:00
2021-01-27 08:05:25 -08:00
2021-05-20 08:17:10 -07:00
2021-05-17 04:07:08 -07:00
2021-05-10 07:04:04 -07:00
2021-01-22 06:01:34 -08:00
2019-10-07 02:36:35 -07:00
2021-01-22 06:01:34 -08:00
2020-09-03 07:40:33 -07:00
2020-09-03 07:40:33 -07:00
2021-01-22 06:01:34 -08:00
2021-03-18 05:56:40 -07:00
2021-06-04 01:01:34 -07:00
2021-07-07 00:58:57 -07:00

Sandbox2

Sandbox2 is a C++ security sandbox for Linux which can be used to run untrusted programs or portions of programs in confined environments. The idea is that the runtime environment is so restricted that security bugs such as buffer overflows in the protected region cause no harm.

Documentation

Detailed developer documentation is available on the Google Developers site for Sandboxed API under Sandbox2.

There is also a Getting Started guide for Sandbox2.