summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2017-05-09Convert a splsoftnet()/splx() dance to NET_ASSERT_LOCKED().Martin Pieuchot
pfctlinput() is only called in the input path with the NET_LOCK() held. ok bluhm@
2017-05-08add a compile time assertion MSIZE == sizeof(struct mbuf)Ted Unangst
ok kettenis mpi tom
2017-05-06Do not export the protocol PCB pointer from kernel to non-root usersAlexander Bluhm
also in the IPv6 case. This fixes "netstat -An -f inet6 -p tcp" and shows 0x0. report and OK dhill@
2017-05-04Also pass the blk offset to disk_unbusy(), so that it can pass it toTheo de Raadt
the random subsystem as entropy. This value is pretty much unknown, and anyways our entropy input ring does not saturate from knowns. ok mikeb djm
2017-05-02Stricter pledge for bpf. ok deraadtMartin Natano
2017-04-30Rename Debugger() into db_enter().Martin Pieuchot
Using a name with the 'db_' prefix makes it invisible from the dynamic profiler. ok deraadt@, kettenis@, visa@
2017-04-30Unifdef KGDB.Martin Pieuchot
It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@
2017-04-30Return ENOSYS for unsupported operation.Martin Pieuchot
2017-04-29Mark futex(2) as PLEDGE_STDIO like all other thread-related syscalls.Martin Pieuchot
From semarie@, ok deraadt@
2017-04-28regenMartin Pieuchot
2017-04-28Add futex(2) syscall based on a sane subset of its Linux equivalent.Martin Pieuchot
The syscall is marked NOLOCK and only FUTEX_WAIT grabs the KERNEL_LOCK() because of PCATCH and the signal nightmare. Serialization of threads is currently done with a global & exclusive rwlock. Note that the current implementation still use copyin(9) which is not guaranteed to be atomic. Committing now such that remaining issues can be addressed in-tree. With inputs from guenther@, kettenis@ and visa@. ok deraadt@, visa@
2017-04-27Enforce that sysctl kern.somaxconn and sominconn can only be setAlexander Bluhm
to valid values. The so_qlimit is type short. report Dillon Jay Pena; OK deraadt@
2017-04-27Unifdef KADB.Martin Pieuchot
ok deraadt@
2017-04-20only 32 bits of the pledgecode were passed up via ktraceTheo de Raadt
from Anton Lindqvist ok semarie
2017-04-20Drop unnecessary headers. This fixes kernel build on platformsVisa Hankala
without <machine/mplock.h>.
2017-04-20Tweak lock inits to make the system runnable with witness(4)Visa Hankala
on amd64 and i386.
2017-04-20Hook up mutex(9) to witness(4).Visa Hankala
2017-04-20Hook up rwlock(9) to witness(4).Visa Hankala
Loosely based on a diff from Christian Ludwig
2017-04-20Hook up mplock to witness(4) on amd64 and i386.Visa Hankala
2017-04-20Add a port of witness(4) lock validation tool from FreeBSD.Visa Hankala
Go-ahead from kettenis@, guenther@, deraadt@
2017-04-18ensure the buffer cache backs off all the way with the correct typeBob Beck
of memory, handling the fact that both queues are actually in dma space when not flipping buffers high
2017-04-17matthieu@ observes % pax (without any arguments) hits pledge violation,Theo de Raadt
because it tries MTIOCTOP against stdin, the tty. It is very inconvenient to use isatty to distinguish this difference in userland, so return ENOTTY for tty devices. ok natano
2017-04-16Flip previously warm pages in the buffer cache to memory above the DMABob Beck
region if uvm tells us it is available. nits from deraadt@ ok krw@ guenther@ kettenis@
2017-04-15After forced unmount of a file system that has other mount pointsAlexander Bluhm
in it, dangling mounts could remain. When unmounting check the hierarcy and unmount recursively. Also prevent that a new mount appears during the scan. Joint work with natano@; testing and OK krw@
2017-04-14Avoid some false positives with cppcheck. No binary change.Alexander Bluhm
OK jsg@
2017-04-13regenPhilip Guenther
2017-04-13Delete the getlogin59 syscall, which was last used one year, two releases,Philip Guenther
and four libc major versions ago ok sthen@ jsing@ deraadt@ jca@
2017-04-13Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itPhilip Guenther
in struct mdproc. With that, all archs have those and the __HAVE_MD_TCB macro can be unifdef'ed as always defined. ok kettenis@ visa@ jsing@
2017-04-11Add SIOCATMARK to allow pledge("inet") programs to call sockatmark(3).Alexander Bluhm
from Matthias Pitzl; OK deraadt@
2017-04-09Correct wakeup() dance in sensor_task_work()Theo de Raadt
Problem noticed by krw
2017-04-08Sensors are run as callbacks inside tasks. During suspend a sensorTheo de Raadt
could be running inside a driver that will be force-detached, or due to tsleep end up disrupting the softstate/hardstate contract. At suspend time, quisce all these callbacks by waiting for completion. This issue has never been observed for real, but may be implicated in suspend/resume failures. ok kettenis guenther mlarkin
2017-04-05timeval has trailing padding on powerpc and m88k, so memset it beforePhilip Guenther
copyout to avoid leaking kernel stack ok deraadt@
2017-04-05Here at OpenBSD we change ABIs at the fling of a hat. Just in case aTheo de Raadt
future disk info sysctl has pads in the structures, use M_ZERO when allocating the storage to avoid leaking kernel memory.
2017-04-05clear structure on the stack before copying out for sysctl. At presentTheo de Raadt
it has no pads, but a future ABI change could add something and leak kernel memory.
2017-04-04struct vfsconf is tightly packed, but let's M_ZERO it in case that everTheo de Raadt
changes to avoid exposing userland memory.
2017-04-02Less convoluted code in soshutdown()Theo de Raadt
ok guenther
2017-03-30correct NBPFILTER #ifdef'sTheo de Raadt
from sthen and others
2017-03-28Allow the multicast ttl/hops and loop options with the mcast pledge.Alexander Bluhm
from Matthias Pitzl; OK deraadt@
2017-03-27If hibernate_alloc() encounters a problem it should undo the partialTheo de Raadt
work. ok mlarkin kettenis
2017-03-27Reorder FREF() and FRELE() in a way that the the global variableAlexander Bluhm
syslogf always points to a file object with increased reference count. This makes the implementation independent from the fact whether changing the reference counter may sleep. pointed out by Mateusz Guzik; OK deraadt@
2017-03-27wrap bpf pledge code in #if BPFFILTERTheo de Raadt
2017-03-26Inside pledge_ioctl, wrap #if's around the complete sub-blocks.Theo de Raadt
2017-03-26For the tape ioctls, recognize that block devices don't exist anymore.Theo de Raadt
Also fail if the descriptor is actually a tty. ok guenther
2017-03-24There was a race in dosendsyslog() which resulted in a crash.Alexander Bluhm
sosend(syslogf->f_data, ...) could be called with a NULL pointer. syslogf was not NULL, f_data was NULL and f_count was 1. The file structure is ref counted, but the global variable syslogf is not protected. So it may change during sleep and dosendsyslog() possibly used a different socket at each access. Solution is to access syslogf only once, use a local copy, and do the ref counting there. OK millert@ deraadt@
2017-03-20Initialize the stack buffer used to build the auxiliary vector to zero toMark Kettenis
avoid leaking the contents of the kernel stack into userspace. ok guenther@, deraadt@
2017-03-18The "ioctl" pledge which was had functionality split out into "tape",Theo de Raadt
"bpf", and "inet" can finally go away. Use a snapshot if you get into trouble, most likely in pax..
2017-03-17Revert the NET_LOCK() and bring back pf's contention lock for release.Martin Pieuchot
For the moment the NET_LOCK() is always taken by threads running under KERNEL_LOCK(). That means it doesn't buy us anything except a possible deadlock that we did not spot. So make sure this doesn't happen, we'll have plenty of time in the next release cycle to stress test it. ok visa@
2017-03-14Allow SIOCGIFXFLAGS in pledge("route") along side SIOCGIFFLAGS, neededFlorian Obser
for upcoming IPv6 stateless address autoconfiguration daemon to see if autoconfiguration and autoconfprivacy are enabled. Input semarie@; OK deraadt@
2017-03-13Move PRU_ATTACH out of the pr_usrreq functions into pr_attach.Claudio Jeker
Attach is quite a different thing to the other PRU functions and this should make locking a bit simpler. This also removes the ugly hack on how proto was passed to the attach function. OK bluhm@ and mpi@ on a previous version
2017-03-11pax conversion was missed; give this another weekTheo de Raadt