summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2017-06-15report contention on caches global data to userland.David Gwynne
2017-06-15white space tweaks. no functional change.David Gwynne
2017-06-15implement the backend of the sysctls that report pool cache info.David Gwynne
KERN_POOL_CACHE reports info about the global cache info, like how long the lists of cache items the cpus build should be and how many of these lists are idle on the pool struct. KERN_POOL_CACHE_CPUS reports counters from each each. the counters are for how many item and list operations the cache has handled on a cpu. the sysctl provides an array of ncpusfound * struct kinfo_pool_cache_cpu, not a single struct kinfo_pool_cache_cpu. tested by hrvoje popovski ok mikeb@ millert@ ----------------------------------------------------------------------
2017-06-14tweak sysctl_string and sysctl_tstring to use size_t for lengths, not intDavid Gwynne
theyre both wrappers around sysctl__string, which is where half the fix is too.
2017-06-13when enabling cpu caches, check the item size against the right thingDavid Gwynne
lists of free items on the per cpu caches are built out the pool items as struct pool_cache_items, not struct pool_cache. make the KASSERT in pool_cache_init check that properly.
2017-06-13use size_t for the size of things in memory, not int.David Gwynne
this tweaks the len argument to sysctl_rdstring, sysctl_struct, and sysctl_rdstruct. there's probably more to fix. ok millert@
2017-06-12Pledge is fairly done, so the kernel printf's can be converted to log()Theo de Raadt
calls. They'll be a little less visible, but still in the system logs. ok bluhm
2017-06-08ASLR, W^X, and guard pages trigger processor traps that result inAlexander Bluhm
SIGILL, SIGBUS, SIGSEGV signals. Make such memory violations visible in lastcomm(1). This also works if a programm tries to hide them with a signal handler. Manual kill -SEGV does not generate false positives. OK deraadt@
2017-06-08make rb_n2e return a struct rb_entry *, not void *David Gwynne
maybe this will help prevent misassignment in the future.
2017-06-08use unsigned long instead of caddr_t to move between nodes and entries.David Gwynne
this removes the need for sys/param.h. this code can be built with only sys/tree.h, which in turn only needs sys/_null.h.
2017-06-08add RBT_SET_LEFT, RBT_SET_RIGHT, and RBT_SET_PARENTDavid Gwynne
this are provided so an RBT and it's topology can be copied without having to reinsert the copied nodes into a new tree. there are two reasons RBT_LEFT/RIGHT/PARENT macros cant be used like RB_LEFT/RIGHT/PARENT for this. firstly, RBT_LEFT and co are functions that return a pointer value, they dont provide access to the pointer itself for use as an lvalue that you can assign to. secondly, RBT entries dont store pointers to other nodes, they point to the RBT_ENTRY structures inside other nodes. this means that RBT_SET_LEFT and co have to get an offset from the node to the RBT_ENTRY and store that.
2017-06-07Add an acct(5) flag for pledge violations. Then lastcomm(1) showsAlexander Bluhm
when something went wrong. This allows to monitor whether the system is under attack and that the attack has been prevented by OpenBSD pledge(2). OK deraadt@ millert@ jmc@
2017-06-07Assert that the KERNEL_LOCK() is held when messing with routing,Martin Pieuchot
pfkey and unix sockets. ok claudio@
2017-06-07Assert that the calling CPU is holding the KERNEL_LOCK() in malloc(9)Martin Pieuchot
and free(9). The exception is at early boot when only one CPU is running since we grab the KERNL_LOCK() relatively late in main(). ok kettenis@
2017-06-03Avoid printing garbage when aborting a program that tries to use aTheo Buehler
prohibited sysctl. ok deraadt
2017-05-31Add support for EV_RECEIPT and EV_DISPATCH flagsMike Belopuhov
From FreeBSD via Jan Schreiber <jes at posteo ! de>, thanks! OK tedu, bluhm
2017-05-31new socketoption SO_ZEROIZE: zero out all mbufs sent over socketMarkus Friedl
ok deraadt bluhm
2017-05-30getrtable() is now permitted in "stdio". It carries no risk factors.Theo de Raadt
2017-05-27Push the NET_LOCK down into PF_KEY so that it can be treated like PF_ROUTE.Claudio Jeker
Only pfkeyv2_send() needs the NET_LOCK() so grab it at the start and release at the end. This should allow to push the locks down in other places. OK mpi@, bluhm@
2017-05-27Use copyin32(9) to atomically copy the futex from user space.Mark Kettenis
On !MULTIPROCESSOR kernels we still fall back on copyin(9), but that is fine. This will break m88k MULTIPROCESSOR kernels. ok deraadt@, mpi@, visa@
2017-05-27Put an assert that M_PKTHDR is set before accessing m_pkthdr in theAlexander Bluhm
mbuf functions. OK claudio@
2017-05-27Refactor m_makespace() using MCLGETI to simplify the logic of this function.Claudio Jeker
Still quite complicated but more legible in the end and it will do less M_GET calls for huge packets. OK bluhm@
2017-05-27Kill option KEY, it is a useless knob, nobody uses pfkeyv2 without IPSEC orClaudio Jeker
tcp md5. OK mpi@
2017-05-22Drop kernel trace points. The trace facility does not exist on OpenBSD.Visa Hankala
2017-05-21Enable radeondrm(4) on loongson to get accelerated graphicsVisa Hankala
with the RS780E chipset. OK kettenis@, jsg@
2017-05-18Add a gap of 1MB between the stack and mmap spaces.Mark Kettenis
ok deraadt@, millert@, stefan@
2017-05-18Do not panic if we find ourself on the sleep queue while being SONPROC.Martin Pieuchot
If the rwlock passed to rwsleep(9) is contented, the CPU will call wakeup() between sleep_setup() and sleep_finish(). At this moment curproc is on the sleep queue but marked as SONPROC. Avoid panicing in this case. Problem reported by sthen@ ok kettenis@, visa@
2017-05-15so_splicelen needs to be protected by the socket lock. We are nowMartin Pieuchot
safe since we're always holding the KERNEL_LOCK() but we want to move away from that. Suggested by and ok bluhm@
2017-05-15Enable the NET_LOCK(), take 3.Martin Pieuchot
Recursions are still marked as XXXSMP. ok deraadt@, bluhm@
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