summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
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.
2015-09-29Delete the final, inscrutable NOSTRICT and VARARGS lint commentsPhilip Guenther
ok millert@
2015-09-28satisfy RAMDISK by placing cold == 2 case inside #ifdef DDBTheo de Raadt
2015-09-28Track size of an opaque allocation to pass to free() laterTheo de Raadt
ok guenther tedu
2015-09-28easy size for free(); ok beckTheo de Raadt
2015-09-28In low-level suspend routines, set cold=2. In tsleep(), use this toTheo de Raadt
spit out a ddb trace to console. This should allow us to find suspend or resume routines which break the rules. It depends on the console output function being non-sleeping.... but that's another codepath which should try to be safe when cold is set. ok kettenis
2015-09-28track sizes for free in sysctl_diskinit(); ok krwTheo de Raadt
2015-09-28make using tame path "/" work.Sebastien Marie
and add a regress test for that. ok deraadt@
2015-09-26regenTed Unangst
2015-09-26unlock the mmap! reminded and ok kettenisTed Unangst
2015-09-25Don't immediately try to checksum the GPT header using the sizeKenneth R Westerback
field from the GPT header being checksum'd. First make sure the size is in a valid range. In particular ensure it won't cause crc32() to run off the end of the GPT header being checksum'd. Also check GPT signature and version first. These checks were inadvertantly moved after the checksumming. This should fix the system crash reported by Ze Loff on bugs@.
2015-09-24buglet: there's no way for req to be STEP in the DETACH case.Ted Unangst
also fix the confusing comment. ok guethner.
2015-09-24Move declaration of readdisksector() to disklabel.h. This makes itKenneth R Westerback
available to other areas of the kernel suffering from an overburden of buf tweaking to read a disk sector. ok mpi@
2015-09-24A couple of missing letoh32() conversions of GPT header fields inKenneth R Westerback
gpt_chk_hdr() and gpt_chk_parts(). Spotted when investigating zeloff's GPT bug report.
2015-09-20Short circuit if we're running on the CPU that we want to sync with. FixesMark Kettenis
suspend on machines with em(4) now that it uses intr_barrier(9). ok krw@
2015-09-19In the internal conversion of _TM_* to TAME_*, some bits were lost forSebastien Marie
"dns" and "cmsg" in the `tamereq' array. Restore the previous behaviour. ok guenther@
2015-09-15Unbeak boot from GPT partition. Reported by Henrik Friedrichsen.YASUOKA Masahiko
ok krw
2015-09-13syncPhilip Guenther