summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2015-10-10I forgot execve would go through the namei codepath, so a program markedTheo de Raadt
"stdio rpath" this would fail to execve. pre-indicate exec actions to the namei checker to allow them through. ok semarie
2015-10-09Allow kill(self, sig) in pledge SELF also. the stack protector, abort(),Theo de Raadt
and readpassphrase() in particular use this. ok millert tedu semarie
2015-10-09Have not come up with a great pattern for flock() yet. flock() is permittedTheo de Raadt
by "getpw" because libc getpw*/getgr* use open() of /var/run/ypbind.lock plus flock() to detect YP running. The kernel observes this dance to "open up" the YP door (ugliness should drive us to rewrite this mechanism from SunOS later). however, flock is also used independently. Current users are htpasswd mail skeyinit tmux authpf pwd_mkdb ldapd smtpd ypbind login_token mail.local lockspool Let's enable flock() for "cpath", and see if that helps these programs, otherwise we'll try "wpath" next.
2015-10-09oops, snuck into a syscalls sync; spotted by sthenTheo de Raadt
2015-10-09another stray )Theo de Raadt
2015-10-09shortcircuit TIOCGETA to directly return ENOTTY for non-ttys. It couldTheo de Raadt
be called against a non-tty fd, so as to test "is this a tty". Discovered by sthen and rob pierce at the same time.
2015-10-09stardate 93370.16: a whitespace appears to have entered our quadrant...Theo de Raadt
2015-10-09multicast test backwards; noted by renatoTheo de Raadt
2015-10-09Rename tame() to pledge(). This fairly interface has evolved to be moreTheo de Raadt
strict than anticipated. It allows a programmer to pledge/promise/covenant that their program will operate within an easily defined subset of the Unix environment, or it pays the price.
2015-10-09syncTheo de Raadt
2015-10-09Rename tame() to pledge(). This fairly interface has evolved to be moreTheo de Raadt
strict than anticipated. It allows a programmer to pledge/promise/covenant that their program will operate within an easily defined subset of the Unix environment, or it pays the price.
2015-10-08Expose a small set of multicast join operators under the request "mcast".Theo de Raadt
This will be used by a few daemons. If they lack this feature, then they would need to operate without tame. Discussed with renato
2015-10-08setsockopt has a small list of options it can set. If we find ourselvesTheo de Raadt
only in TAME_UNIX, stop trying after servicing SOL_SOCKET. discussion with claudio
2015-10-08Only in TAME_ROUTE, allow ioctl SIOCGIFADDR/SIOCGIFFLAGS/SIOCGIFRDOMAIN,Theo de Raadt
because many routing daemon processes with this attribute need to fetch that information to work. discussed with claudio and renato
2015-10-08Use the radix API directly and get rid of the function pointers. ThereMartin Pieuchot
is no point in keeping an unused level of abstraction. ok mikeb@, claudio@
2015-10-07Split out routing sysctl's from tame "inet", and put them into theTheo de Raadt
new tame "route" request. Now routing daemons and tools (such as arp), can narrowly ask for either feature. One thing remains available in both cases -- support for getifaddr()'s, since libc and programs often use that in close association with socket creation. ok benno sthen beck, some discussion with renato
2015-10-07easy free sizes; ok mpiTheo de Raadt
2015-10-07rn_inithead() offset argument is now specified in byte, missed in previous.Martin Pieuchot
2015-10-07Initialize the routing table before domains.Martin Pieuchot
The routing table is not an optional component of the network stack and initializing it inside the "routing domain" requires some ugly introspection in the domain interface. This put the rtable* layer at the same level of the if* level. These two subsystem are organized around the two global data structure used in the network stack: - the global &ifnet list, to be used in process context only, and - the routing table which can be read in interrupt context. This change makes the rtable_* layer domain-aware and extends the "struct domain" such that INET, INET6 and MPLS can specify the length of the binary key used in lookups. This allows us to keep, or move towards, AF-free route and rtable layers. While here stop the madness and pass the size of the maximum key length in *byte* to rn_inithead0(). ok claudio@, mikeb@
2015-10-07Add the tame "exec" request. This allows processes which requestTheo de Raadt
"exec" to call execve(2), potentially fork(2) beforehands if they asked for "proc". Calling execve is what "shells" (ksh, tmux, etc) have as their primary purpose. But meantime, if such a shell has a nasty bug, we want to mitigate the process from opening a socket or calling 100+ other system calls. Unfortunately silver bullets are in short supply, so if our goal is to stay in a POSIX-y environment, we have to let shells call execve(). POSIX ate the world, so choices do we all have? Warning for many: silver bullets are even more rare in other OS ecosystems, so please accept this as a narrow lowering of the bar in a very raised environment. Commited from a machine running tame "proc exec" ksh, make, etc.
2015-10-06A process should be able to do sigpending for itselfTheo de Raadt
2015-10-06For TAME_PROC, allow setrlimit()Theo de Raadt
2015-10-06When "proc" is requested, allow setpgid() and sigsuspend().Theo de Raadt
Also the combination of "proc tty" needs to permit TIOCSPGRP. This is the start at minimum semantics required by processes which work on process groups, sessions, ttys.
2015-10-06Add new "tty" request, which allows TIOCGETA, TIOCGPGRP, TIOCGWINSZ,Theo de Raadt
TIOCSBRK, TIOCCDTR, TIOCSETA, TIOCSETAW, and TIOCSETAF on tty vnodes. This helps programs which call tcsetattr(), tcgetattr(), or readpassphrase(). Especially the latter - tame's goal is to satisfy the libc requirements of security-sensitive programs. Remove TIOCSETAF from the basic "ioctl" request, because it is a "set" option. "ioctl" is slowly turning into a "request information, cannot set options" package. Split the "cmsg" request into "sendfd" and "recvfd". Non-SCM_RIGHTS messages are currently flowing through freely and we'll need to think about that. This split lets us more strictly describe what our many fd-passing programs will do.
2015-10-06Rework the tame cmsg handler to make it work both ways. While on recv oneClaudio Jeker
mbuf blob with all the cmsgs inside while on send cmsgs in an mbuf chain, one mbuf per message. Adjust the calls accordingly. Putting it in so deraadt@ can move forward.
2015-10-06rmdir() is just a CPATH operation; remove RPATH marker that snuck in.Theo de Raadt
2015-10-06Make sure that all padding bytes in cmsgs are actually zero by memsetClaudio Jeker
CMSG_SIZE(len) bytes of the mbuf.
2015-10-06oops, namei was never allowing through valid CPATH operationsTheo de Raadt
2015-10-06Add getrusage() to the TAME_SELF catagory.Theo de Raadt
2015-10-06Enable ioctl() in the "rw" request, to support FIONREAD/FIONBIO easierTheo de Raadt
for the stdio/libevent usage case. Further ioctl commands are narrowly checked as before. ok djm guenther semarie
2015-10-04Move getcwd to a seperate area, with a hand-waving explanation for whyTheo de Raadt
it is RPATH|WPATH... nothing changes, just the new explanation.
2015-10-04Allow sysctl read of vm.vm_psstrings, as setproctitle() uses this toTheo de Raadt
find the ps buffer. Few programs want to do their first setproctitle() rather late...
2015-10-04spellingTheo de Raadt
2015-10-03Add ktracing of tame()'s arguments' valuesPhilip Guenther
"every tool helps" deraadt@
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-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...
2015-10-02kern_tame.cTheo de Raadt
2015-10-02regenMark Kettenis
2015-10-02Revert previous commit; something is not quite right yet in the bowels of uvmMark Kettenis
as Theo is seeing vnode-related panics on several architectures in the codepath that implements mmap(2).
2015-10-02missing ) in COMPAT_LINUX blockTheo de Raadt
2015-10-02Actually, open of /etc/spwd.db must be handled by returning EPERM, notTheo de Raadt
dropping through to to the kill path. The best way to understand this is id(1). It calls getpwuid, which tries /etc/spwd.db before /etc/pwd.db ...
2015-10-02Add ktracing of argv and envp to execve(2), with envp not traced by defaultPhilip Guenther
ok tedu@ deraadt@
2015-10-02mention these pathname calls are checked in nameiTheo de Raadt
2015-10-02remove some debug printf no longer neededTheo de Raadt
2015-10-02changed my mind; block spwd.db, force drop-through to pwd.db for processes ↵Theo de Raadt
under tame
2015-10-01Fix tame(2) setsockopt check for TCP level.Doug Hogan
ok deraadt@, semarie@
2015-10-01add IPv6 equivalents for the permitted IPv4 setsockopts, noticed by doug@,Stuart Henderson
ok semarie@
2015-09-30implement new "prot_exec" tame(2) request:Sebastien Marie
- by default, a tamed-program don't have the possibility to use PROT_EXEC for mmap(2) or mprotect(2) - for that, use the request "prot_exec" (that could be dropped later) initial idea from deraadt@ and kettenis@ "make complete sense" beck@ ok deraadt@
2015-09-29Save a lot of people grief. tame()'d CMSG reception is busted and itTheo de Raadt
will take some time to fix it. Problem appears to be that the control mbuf is not normalized into flat memory.
2015-09-29Reluctantly classify statfs and fstatfs as RPATH for now, because theyTheo de Raadt
leak system path information. Should be reconsidered in the future.