summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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".
2015-10-03sed only works on files, so the obvious goal is to remove it's networkTheo de Raadt
access in case it is exploited. tame with "stdio wpath rpath cpath" seesms to covers all usage cases, except -i performs a fchmod() on the in-place file, so conditionally also needs "fattr". ok sthen
2015-10-03ping6 is a setuid root priv-drop which holds a sockraw. we can tame itTheo de Raadt
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. ping6 is a bit trickier than ping, because it uses recvmsg() with CMSG types of IPV6_HOPOPTS, IPV6_DSTOPTS, IPV6_RTHDRDSTOPTS, IPV6_RTHDR. there is further work to do in the kernel, with claudio! work with florian a while back, which involved hoisting lots of initization code upwards. ok doug
2015-10-03tcpdump is two-process privsep.Theo de Raadt
the packet processor pid is initialized on a socketpair, and then only does byte analysis. it can be protected using a "stdio" tame request. an successfull attack against it will find it cannot open files nor sockets, and faces various other limitations described in the tame(2) manual page. the monitor process can be restricted to "malloc cmsg inet ioctl dns rpath". that sounds like a large subset, but notice it cannot create or write files. maybe this set can be wittled down by hoisting more initialization code upwards? with help from canacar a while back.
2015-10-03ping is a setuid root priv-drop which holds a sockraw. we can tame itTheo de Raadt
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. work with florian a while back ok doug
2015-10-02Curve25519 is now specified in draft-ietf-ipsecme-safecurves-00 (alongReyk Floeter
with Curve448). And we already support it. Mention it here to update the Id when it was assigned by IANA.
2015-10-02make a && && & block more readable. no binary change.Theo de Raadt
discussed with otto
2015-10-02I see no evidence that lstat() is being done for /etc/resolv.conf, norTheo de Raadt
can I figure out why I added this in the past...