summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2015-08-23recompute len when the path is absolute as canonpath could have shrink itSebastien Marie
OK deraadt@
2015-08-22Move to tame(int flags, char *paths[]) API/ABI.Theo de Raadt
The pathlist is a whitelist of dirs and files; anything else returns ENOENT. Recommendation is to use a narrowly defined list. Also add TAME_FATTR, which permits explicit change operations against "struct stat" fields. Some other TAME_ flags are refined slightly. Not cranking libc now, since nothing commited in base uses this and the timing is uncomfortable for others. Discussed with many; thanks for a few bug fixes from semarie, doug, guenther. ok guenther
2015-08-21Whitelist TIOCGPGRP (for tcgetpgrp()) in TAME_IOCTL.Doug Hogan
Requested by Sunil Nimmagadda to help tame http. ok deraadt@
2015-08-21re-enable *8.David Gwynne
if we're allowed to try and use large pages, we try and fit at least 8 of the items. this amortises the per page cost of an item a bit. "be careful" deraadt@
2015-08-20reactivate tame()Theo de Raadt
2015-08-14provide ml_requeue and mq_requeue for prepending mbufs on lists/queuesDavid Gwynne
ok mpi@ claudio@
2015-08-12Remove last two 'uses' of d_subtype in tree. No point in settingKenneth R Westerback
it to 0 immediately after a bzero() of the entire label. Nor in swapping endianness since nobody looks at it. Don't touch the actual field in disklabel. Yet. ok deraadt@ as part of larger diff that needs splitting up.
2015-08-03Unfortunately netstat did not show sockets without file descriptorsAlexander Bluhm
since it had been converted from kvm to sysctl. This was hiding a bunch of TCP states which are important for network debugging. Loop over the internet PCB tables to fill the network information into the KERN_FILE_BYFILE sysctl result. Skip internet sockets when looping over the file desciptors. From markus@; OK guenther@; Go for it deraadt@
2015-08-01Fix free() of uninitialized variable introduced in previous commit.Philip Guenther
Eliminate the goto that I tripped on. problem noted by Mark Latimer (mark.latimer (at) gmail.com) ok miod@ millert@
2015-07-29Neuter tame(2) with ENOSYS for upcoming release cycle, in a fairlyTheo de Raadt
simple and gross fashion, but the least impact on other parts...
2015-07-29Zap a couple of extra blank lines that keep showing up in diffs I'mKenneth R Westerback
trying to build.
2015-07-28Convert sectors to DEV_BSIZE block values were necessary to find,Kenneth R Westerback
read and validate disklabels on GPT partitioned disks. Makes it much more likely GPT partitioned disks with non-512-byte sectors will work. Part of the larger reverted GPT work. ok deraadt@
2015-07-28normalize disclaimer to license.template; noted by reykTheo de Raadt
2015-07-28For unix domain sequenced packet socket pairs the ruby regressionAlexander Bluhm
tests reported an EMSGSIZE error although the sent message was not too large. The way backpressure was implemented for unix domain sockets confused the check in sosend(). Unix domain sockets append data only to the recv buffer. To report the amount of content to the sender, the high watermark of the send buffer was reduced. This happend for SOCK_STREAM and SOCK_SEQPACKET. Sosend checks wether atomic chunks could ever fit into the send buffer which is limited by the high watermark. This happens for SOCK_DGRAM and SOCK_SEQPACKET. For SOCK_SEQPACKET the combination of these mechanisms resulted in an EMSGSIZE error when the buffer got filled. This also happened when space could be created by reading from the other end in contradiction to the semantics of EMSGSIZE. Do not emulate a send buffer that has no space. It is better to fill the buffer with fake data than to reduce its size. Thus the high watermark always contains the real value. When disconnecting, reset the counters. Otherwise the socket layer would try to flush non existing data in the send buffer. Tested by jeremy@ with a C program and the ruby tests. OK markus@ jeremy@
2015-07-28Add ktracing of structs iovec, msghdr, and cmsghdr for {,p}{read,write}v(),Philip Guenther
sendmsg(), and recvmsg(). For cmsghdr, the len, level, and type are always shown, and for SOL_SOCKET,SCM_RIGHTS the fd numbers being passed are shown. ok millert@ deraadt@
2015-07-27Rather than disabling tame to coredump, leave it enabled but flag thatTheo de Raadt
a coredump is happening. This improves behaviour while threaded. ok semarie
2015-07-27enforce tame by disabling all TAME_ flags if tame_fail() is reach, and not onlySebastien Marie
if TAME_ABORT is setted. ok deraadt@
2015-07-27tame check of msghdr should be done after checking for copyin failurePhilip Guenther
ok deraadt@
2015-07-26Always initialize the b_error field and B_ERROR flag before usingKenneth R Westerback
a buf. Otherwise stale data might cause a successful I/O to be seen as a failed I/O. ok tedu@
2015-07-23Revert attempted GPT code cleanup. Too much code, too little testing.Kenneth R Westerback
Requested by deraadt@
2015-07-23remove the POOL_NEEDS_CATCHUP macro, it isnt used.David Gwynne
from martin natano
2015-07-23Replace TIOCSWINSZ with TIOCGWINSZ in tame(2).Doug Hogan
ok deraadt@
2015-07-22Slam signal handlers harder in tame_fail(), found by semarie.Theo de Raadt
Also delete some prototype KTRACE code which is not headed in the right direction.
2015-07-22memory leak in execve with systrace, plus some unreachable codeTheo de Raadt
spotted by Maxime Villard ok guenther millert
2015-07-21Always permit kbind (for dynamic linking) and add __thrsigdivert to thePhilip Guenther
SELF list like the other threading calls ok deraadt@
2015-07-21hookup octeonJasper Lievisse Adriaanse
ok deraadt@
2015-07-20Move `ticks' declaration to sys/kernel.h.Masao Uebayashi
2015-07-20Fix tty hiwat handling a bitStefan Fritsch
- Introduce new defines TTHIWATMINSPACE, TTMINHIWAT for some magic values that are used in tty.c. - Remove hiwat adjustments in ttwrite(). This fixes this codepath not being interrupt safe. - Change ttysetwater() to keep at least TTHIWATMINSPACE space above the high water mark. This makes it consistent with ttycheckoutq(). Without this change, the hiwat adjustment change above causes deadlocks in pty. ok kspillner@ commit it now deraadt@
2015-07-20crudely canonicalize paths before taming them. ok deraadt dougTed Unangst
2015-07-20Move the construction of p_tamenote from sys_open() to doopenat(), so thatTheo de Raadt
it also applies to sys_openat().
2015-07-20Allow the sched_yield, __thrsleep, __thrwakeup, and __threxit syscallsJeremy Evans
when using tame(2). This allows threaded programs to work. OK deraadt@
2015-07-20In _TM_SELF, permit uname(3); OK deraadt@.Ingo Schwarze
2015-07-20Be more paranoid and don't let any ioctls through with invalid fileNicholas Marriott
descriptors.
2015-07-20Don't try to dereference fp if it is NULL, ok deraadtNicholas Marriott
2015-07-20tame_cmsg_send and tame_cmsg_recv are called with the data set to a fileNicholas Marriott
descriptor, so call fd_getfile to get a struct file *. ok deraadt
2015-07-20getpagesize() may occur late in programs; permit itTheo de Raadt
2015-07-20Add setgroups(2) to TAME_PROC, ok deraadtNicholas Marriott
2015-07-20In TAME_IOCTL, permit BIOCGSTATS on a vnode. We don't drill down deeperTheo de Raadt
yet to verify it is a bpf node. Will be used by tcpdump privsep side.
2015-07-20rebuildPhilip Guenther
2015-07-20Add kbind, a syscall for ld.so to use to securely and efficiently updatePhilip Guenther
memory for lazy binding ok deraadt@
2015-07-20Fix annoying console spew when we can't write the core file. use log instead.Bob Beck
ok krw@ sthen@ comments from deraadt@, miod@
2015-07-19Repair various strncmp lengths, noticed by Brandon CaseyTheo de Raadt
2015-07-19Change uvm_page[re]alloc_multi to actually use the flags passed in, and returnBob Beck
a value so that they may be called with UVM_PLA_NOWAIT ok kettenis@
2015-07-19Use two 2q caches for the buffer cache, moving previously warm buffers from theBob Beck
first queue to the second. Mark the first queue as DMA in preparation for being able to use more memory by flipping. Flipper code currently only sets and clears the flag. ok tedu@ guenther@
2015-07-19Make KTR_SYSRET records variables variables sized, leaving out thePhilip Guenther
retval on error, including a long long retval on successful lseek(), and including a register_t retval for other successes. This fixes lseek reporting on ILP32 archs. While here, reworking internal kern_ktrace.c bits to be able to pass two buffers to ktrwriteraw(), so we can avoid mallocing a buffer in some cases and so that KTR_GENIO logs are split at PAGE_SIZE, not PAGE_SIZE-sizeof(struct ktrgenio) ok miod@
2015-07-19syncTheo de Raadt
2015-07-19tame(2) is a subsystem which restricts programs into a "reduced featureTheo de Raadt
operating model". This is the kernel component; various changes should proceed in-tree for a while before userland programs start using it. ok miod, discussions and help from many
2015-07-18Change unp_scan() and its callbacks to pass the array of struct file **Philip Guenther
and a count instead of calling the callback on each one, while also renders the 'dispose' argument superfluous. Move unp_*() prototypes from <sys/un.h> to <sys/unpcb.h> ok claudio@ mpi@
2015-07-18Kill emul left-over.Martin Pieuchot
From Martin Natano
2015-07-17manage spd entries by using the radix api directly instead ofBret Lambert
reaching around through the routing table original diff by myself, much improved by mikeb@ and mpi@ ok and testing mikeb@ mpi@