summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-10-03tame "stdio rpath" is sufficient for all the operations done by test(1)Theo de Raadt
2015-10-03Track a size in the scary area of cluster_collectbufs, so that we knowTheo de Raadt
what to free. ok beck
2015-10-03Initially eric developers asr as a side-load style library for async DNS.Theo de Raadt
When it was integrated as the main resolver, a bunch of strange initialization code remained. Start whittling away at this, piece by piece, to make it more clear. ok eric
2015-10-03option LFS is dead, but we missed option ACCOUNTING herePhilip Guenther
2015-10-03you can't edit stdin in place. check for this before the hack thatTed Unangst
increments argc when run with no arguments, causing a read past the end of argv.
2015-10-03There is no need to keep a global array of sysconf(_SC_OPEN_MAX) elementsTed Unangst
just to keep track of a single pid. Return it to the caller and make it their problem. ok deraadt millert
2015-10-03Enable eigrpd(8) and eigrpctl(8) in the buildsRenato Westphal
ok deraadt@
2015-10-03obvious tame "stdio rpath"Theo de Raadt
ok semarie
2015-10-03Now that dc(1) no longer supports !command with popen(), we can startTheo de Raadt
off with tame "stdio rpath". Once the (optional) file is opened, a further drop down to tame "stdio" works.
2015-10-03delete documentation for ! commandTheo de Raadt
2015-10-03Nuke trailing whitespace to avoid cluttering possible upcoming diffs.Kenneth R Westerback
2015-10-03adapt to the removal of !Otto Moerbeek
2015-10-03disable ! command, makes dc(1) more tameableOtto Moerbeek
2015-10-03oops! cannot tame the chmod case, because the kernel drops theTheo de Raadt
setuid/setgid bits.
2015-10-03hard to think of a simple program to add tame to. tame "stdio", obviously.Theo de Raadt
2015-10-03wc only opens files read-only, proceses them, and spits results to stdout.Theo de Raadt
tame "stdio rpath" works, right before calling getopt()
2015-10-03correct a memory leak in error code path.Sebastien Marie
noticed by miod@ ok visa@
2015-10-03As pointed out by tobiasu, ed-style patches still use popen() and executeTheo de Raadt
/bin/ed. This is RETARDED. Nothing learned from the last year? Add tame "proc" until that is fixed, to allow fork+exec. I beg for someone to cross-link the guts of ed directly into patch, or write a ed-subset which can do the job.
2015-10-03Restore description of the sparc64 boot process which was lost whenStefan Sperling
MD installboot was moved to the attic. Put it into boot_sparc64(8), which still pointed readers at installboot(8) for this information. With some markup tweaks from schwarze@
2015-10-03- Simplify use of ctype functions.Tim van der Molen
- Replace arc4random with arc4random_uniform. - Replace memset with explicit_bzero. OK millert@
2015-10-03unifdef some features we will always have. ok benno zhukTed Unangst
2015-10-03tame "stdio" right between setlocale and getopt, it is easy to reviewTheo de Raadt
this program and see it does uname(3) and stdio printf. uname(3) is backed by a cluster of sysctl() reads, all permitted by the kernel in tame_sysctl_check()
2015-10-03IPv6 transport for pflow data.Florian Obser
Input deraadt@ Bug fix & OK benno@
2015-10-03Properly indent usage() output.Antoine Jacoutot
2015-10-03missing asr* -> _asr* symbol rename for building with debug codeEric Faurot
ok jca@
2015-10-03If we care about placing core files from SUID programs in a safe place,Vadim Zhukov
lets do not suggest to provoke races and use -m option of mkdir(1). ok guenther@, "don't care" deraadt@ :)
2015-10-03Fix wrong cast.Vadim Zhukov
This one should be an unsigned long in theory, but the formatter function argument we're printing from is already an int (being casted from register_t at the formatter call time). So lets fix one bug at a time. authoritative okay from guenther@
2015-10-03When multiple vxlan interfaces are configured with same VNI, select theYASUOKA Masahiko
interface whose tunnel destination corresponded to the incoming packets' source address. ok reyk
2015-10-03SSL_new(): fix ref counting and memory leak in error path.Doug Hogan
Rather than a half-hearted attempt to free up resources and fix ref counting at the SSL_CTX level, let SSL_free() do its job. This diff got lost in the shuffle somewhere. It's from last year. Ref counting error reported by Parakleta in github ticket #51. Thanks! ok jsing@, beck@
2015-10-03grep only opens files read-only, reads via stdio or other methods, performsTheo de Raadt
computation, and outputs result to stdout. (note: in the tame model, malloc is implicit because stdio needs it, and mmap is implicit since malloc needs it; libz is satisfied by this environment also). this tame change consists of 1 line, setting "stdio rpath" before getopt. this protection is fairly strict. grep could be improved further by computing a wpathlist based on argv, keeping -R in mind. feel free to take a shot at it. grep was an early target of capsicum also. know anyone running capsicum grep? ok doug
2015-10-03tame "stdio getpw rpath" can be done quite early after the getopt.Theo de Raadt
it might seem we can hoist the open above tame and then drop "rpath", but guenther found getprotobynumber can be called much later. ok guenther
2015-10-03leave does a fork, but other than that it is boring stdio.Theo de Raadt
tame "stdio proc" satisfies it. ok doug
2015-10-03the chmod & chflags codepaths can use tame "stdio rpath fattr". theTheo de Raadt
chown codepath obviously cannot use tame -- once tame is activated the kernel prohibits changing uid/gid on a fd/file. ok guenther
2015-10-03gzip can use tame "stdio wpath cpath fattr". this blocks a lot ofTheo de Raadt
system behaviours such as forking, execve, sockets, etc. in theory this extended by parsing the arguments first, and creating the whitepathlist. the pathlist probably needs to be directory-oriented, rather than exact path of files, because a gzip file may specify the filename it wants (and that won't be available until it is opened, and partially parsed). anyone want to give this a try? gzip was an early goal for capsicum. who is running a capsicum gzip?
2015-10-03BIO_get_fd() could return fd 0; fix error condition. Found atTheo de Raadt
http://marc.info/?l=openssl-dev&m=144374015404899&w=2 ok doug
2015-10-03KNFTheo de Raadt
2015-10-03right at startup, this can tame "stdio cpath rpath wpath". after getoptTheo de Raadt
-h has handled write/creating a file, we can drop to tame "stdio rpath" since md5 will only read files after that. i believe i involved lteo for this.
2015-10-03So you'd love me to say sleep() can be tighter than tame "stdio". OK,Theo de Raadt
there is that pesky usage message... We could tame "something" in the non-usage codepath.. but pop quiz, anyone know what happens after main returns or if exit(3) is called? atexit completion.. our atexit is very paranoid with structure management and uses mprotect. So current minimum a normal program needs is tame "malloc". tame "stdio" done before the usage codepath splits is just as good; tame placement before getopt provides a strong hint about program behaviour. I am still hoping someone comes up with a nice solution for atexit, or a nice tame subset between "" (pure computation) and "malloc". Ideas have been floated to expose "self", but it lacks mprotect also, and should continue to lack it (see the ssh tame sandbox).
2015-10-03the ntp dns process only needs tame "dns rw" to operate. at least,Theo de Raadt
that's the case after kernel code got fixed to handle inet6 for dns...
2015-10-03In the ntpctl(1) case, after it has connect()'d to ntpd we can tame "stdio"Theo de Raadt
since that is all it will do till termination.
2015-10-03switch from using the systrace-based sandbox to the tame-based sandbox.Theo de Raadt
discussed it at length with djm -- i think it is time to give this a trial in snapshots.
2015-10-03patch appears to work fully with tame "stdio rpath wpath cpath tmppath fattr".Theo de Raadt
in case of exploitation, no more network access, fork, execve, etc. I wonder if we could use whitepath lists here - if it is reasonable to limit operation in directories known early on?
2015-10-03arp uses a non-privileged sockraw to look at the kernel arp tables.Theo de Raadt
the function to do that is called a number of times, but as needed. hoist it upwards into initization, then tame "stdio dns inet" is possible in most code paths. (there may be further work to do here here) i believe florian helped me with this.
2015-10-03like ping, traceroute is a setuid root priv-drop which holds a sockraw.Theo de Raadt
we can tame it substantially with "stdio inet", plus "dns" if the -n option is missing. a successful exploit against it then cannot create files, or perform a variety of other operations, as described in the tame(2) man page. florian helped me a fair bit hoisting initization code upwards in ping, ping6, and traceroute, to make tame work here.
2015-10-03uniq has a complicated initialization around getopt. beforehands, weTheo de Raadt
can tame "stdio rpath wpath cpath"; all three paths abilities are needed for it to setup the right files (worst case spotted by sthen). later once the files are opened, the program is only looking at strings and outputing via stdio functions, so we can tame "stdio".
2015-10-03script is two processes. the main io-loop process can be locked down withTheo de Raadt
tame "stdio" since all it does is move data back and forth, while the master process needs "stdio ioctl" to use TCSAFLUSH at the very end. TCSAFLUSH is included in the kernel's rather restrictive ioctl feature lists made available with the "ioctl" ability.
2015-10-03finger can either do local users only, or in in remote users. (whoTheo de Raadt
still runs fingerd? not many places, it took a while to find a server) tame "stdio getpw rpath inet" is possible early on, then later when the network lookups list is consumed, tame "stddio getpw rpath"
2015-10-03whois uses dns to lookup whois servers, and then opens sockets to them.Theo de Raadt
it does not need to open any files, so we can tame with "stdio dns inet". i think florian and i did this about 2 months ago.
2015-10-03even before it reaches getopt(), this program will never do more thanTheo de Raadt
talk to stdio. tame "stdio" is a no-brainer. reviewed a while ago by doug
2015-10-03acpidump is used as root and opens /dev/mem readonly, to dig outTheo de Raadt
the AML tables. (If this offends you, feel free to submit a diff with a better extraction mechanism). After hoisting the /dev/mem-opening code earlier, we can tame this nasty program with "stdio wpath cpath".