summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2016-03-01Copy the stackgap_init() and stackgap_alloc() functions fromChristian Weisgerber
compat/common/compat_util.c to dev/systrace.c, the one place they are used, and remove the remaining kernel references to compat/*. ok visa@
2016-02-29delete the kern.emul/KERN_EMUL sysctl bits since there are noChristian Weisgerber
emulations left; ok millert@ deraadt@, jmc@ (man pages)
2016-02-28Support for running Linux binaries under emulation is going away.Christian Weisgerber
Remove "option COMPAT_LINUX" and everything directly tied to it from the kernel and the corresponding man page documentation. ok visa@ guenther@
2016-02-23provide m_dup_pkt() for doing fast deep mbuf copies with a specified alignmentDavid Gwynne
if a physical interface receives a multicast/broadcast packet and has carp interfaces on it, that packet needs to be copied for reception by each of those carp interfaces. previously it was using m_copym2, but that doesn't respect the alignment of the source packet. this meant the ip header in the copies were aligned incorrectly for the network stack, which breaks strict alignment archs. m_dup_pkt lets carp specify that the payload needs an ETHER_ALIGN adjustment, so the ip header inside will be aligned correctly. reported and tested by anthony eden who hit this on armv7 i reproduced the problem on sparc64 and verified the fix on amd64 and sparc64 ok mpi@ mikeb@ deraadt@
2016-02-17Return ENOTTY for TIOCFLUSH when allowed by pledge but the fd isTodd C. Miller
not a tty. Fixes a pledge failure in telnet when piping the output. OK deraadt@
2016-02-11Make sure uiomove does not copy more than uio_resid bytes, as the manualStefan Kempf
says. Move code belonging to diagnostics in the #ifdef DIAGNOSTIC part and add a KASSERT that makes sure that we do not run beyond uio_iov. Diff from Martin Natano.
2016-02-08"exceeds past the end" -> "extends past the end" in comment.Kenneth R Westerback
2016-02-01add a DIAGNOSTIC for refcnt_take overflow.David Gwynne
ok mpi@
2016-01-31- m_pkthdr.pf.statekey changes are not ready for 5.9, I must back them outAlexandr Nedvedicky
OK sthen@
2016-01-28Convert to uiomove. Diff from Martin Natano.Stefan Kempf
2016-01-19Convert min() and uiomovei() to ulmin() and uiomove(),Stefan Kempf
preventing integer truncation. Diff from Martin Natano ok kettenis@
2016-01-19Check if the vnode type is VBAD (corresponds to disconnectedAlexandre Ratchov
usb devices) and return ENOTTY rather than terminating the caller program. Found by Michael Reed <m.reed at mykolab.com> ok semarie, deraadt
2016-01-18Add SYS_truncate as a "wpath" operation. Omission noticed by tb and sthen.Theo de Raadt
2016-01-15Convert to uiomove(); from Martin NatanoStefan Kempf
ok millert@
2016-01-15Improve the socket panic messages further. claudio@ wants to seeAlexander Bluhm
the socket type and dlg@ is interested in the pointers for ddb show socket. OK deraadt@ dlg@
2016-01-15KASSERT on refcnt underflow.David Gwynne
ok mpi@ bluhm@
2016-01-15print TAILQ_NEXT(so, so_qe) tooDavid Gwynne
2016-01-15add a "show socket" command to ddbDavid Gwynne
should help inspecting socket issues in the future. enthusiasm from mpi@ bluhm@ deraadt@
2016-01-14Increase buffer sizes and watermarks for tty and pppStefan Fritsch
Use 115200 the default speed for buffer sizing in ttymalloc(). A lot of devices call ttymalloc(0) so this affects quite a few of them. Increases the buffer size for 9600 < baud <= 115200 from 1k to 4k. Make ppp use the lo/hi watermarks from the tty layer which are adjusted according to speed + buffer size. The previous fixed values of 100 and 400 were way too small Make pty call ttymalloc() with baud == 1000000, which is the common value used in the tree for "fast". ok deraadt@
2016-01-13To make bug hunting easier, print more information in the soreceive()Alexander Bluhm
and somove() panic messages. OK phessler@ benno@ deraadt@ mpi@
2016-01-13Convert to uiomove(); from Martin Natano, thanks!Stefan Kempf
ok deraadt@
2016-01-09drop "abort" promise, and make it the default behaviour.Sebastien Marie
The current code has already setted it by default since 1.74 any pledge failure tries to make a coredump (default rules for coredump still applies: so setuid binaries don't create them locally). ok deraadt@
2016-01-08Add "vmm" pledge to allow restricted ioctl access to /dev/vmm.Reyk Floeter
This will allow to pledge vmd(8)'s vmm and vm processes, so that VMs themselves run "sandboxed", including their host-side virtio layer. It will remain disabled for now (in userland) to not get into the way of ongoing development and upcoming changes in vmd and the ioctl interface. OK mlarkin@ deraadt@ "kernel side in, but not the callers in userland"
2016-01-08On the recvmsg() side, cmsgs are in mbuf chains, not a contiguous buffer.Philip Guenther
ktrace each cmsg instead of reading beyond the end of the first cmsg. problem report and testing by abieber@ ok millert@ deraadt@
2016-01-07- retrying to commit earlier change, which got backed outAlexandr Nedvedicky
- yet another tiny step towards MP PF. This time we need to make sure statekey attached to packet stays around, while accepted packet is routed through IP stack. this time I'm also bringing fix contributed by Stefan Kempf. Stefan's fix makes sure we grab reference in m_dup_pkthdr() OK bluhm@
2016-01-07In sendsyslogd(2) strip off syslog priority when logging to console.Alexander Bluhm
OK deraadt@ millert@
2016-01-06turn off the whitepath code for now; we're not sure it's ready for releaseTed Unangst
ok deraadt
2016-01-06remove unnecessary casts where the incoming type is void *.Ted Unangst
2016-01-06tidy up whitespace, etc.Ted Unangst
2016-01-06Prevent integer overflows in sosend() and soreceive() by convertingStefan Kempf
min()+uiomovei() to ulmin()+uiomove() and re-arranging space computations in sosend(). The soreceive() part was also reported by Martin Natano. ok bluhm@ and also discussed with tedu@
2016-01-06Add pledge "drm", which allows a subset of the drm(4) ioctls. These areMark Kettenis
basically only the ioctls that Linux allows on the so-called "render nodes". For now, it also allows DRM_IOCTL_GET_MAGIC and DRM_IOCTL_GEM_OPEN, as we don't implement prime/dma-buf yet in OpenBSD. That still leaves a big gaping hole, so they will be removed as soon as we can. Based on a diff by robert@, who did all the heavy lifting by studying the behaviour of the chromium GPU process, with some further suggestions by deraadt@. ok jsg@, deraadt@, robert@
2016-01-05annoying whitespaceTheo de Raadt
2016-01-03copyright++;Jonathan Gray
2016-01-02mmcc noticed that nd.ni_pledge was uninitialized in doopenat() for theTheo de Raadt
oflags & 3 == 3 case. Therefore this depends on vn_open() blocking the operation later. Probably this meant the ni_pledge request would be too high, causing transient operation failure, rather than transient operation passage). Instead of initializing based on the oflags value use the result of FFLAGS(). I should have done this from the start. ok semarie [oflags & 3 == 3 is major dejavu for me]
2016-01-01The pointer buf is a user space string which was directly passedAlexander Bluhm
to tputchar() and could crash the kernel. Better use cnwrite() in sendsyslog2() for writing to console. It takes a struct uio which does the copyin() automatically. In addition cnwrite() outputs to the real console or to a redirected one, whichever is appropriate. One drawback is that the syslog priority cannot be stripped off easily. OK deraadt@
2015-12-31NULL-terminate a pointer array to prevent an invalid free, and simplifymmcc
the associated pointer incrementing logic. Reported by Maxim Pugachev. Looks good to tedu@
2015-12-27Add missing #include "audio.h". Fixes sndiod pledge issue reported bytb
timo.myyra () wickedbsd ! net, thanks! While there, remove extraneous "pty.h". ok deraadt@
2015-12-27wrap "audio" pledge code in NAUDIO > 0, because there are a fewTheo de Raadt
GENERIC kernels which lack audio drivers.
2015-12-24Make gpt_chk_mbr() instances even more identicaller by alwaysKenneth R Westerback
returning 0 or 1 since only boolean checks of the result are done. No need for EINVAL as a return value.
2015-12-24Make all instances of gpt_chk_mbr() identical (bar static vsKenneth R Westerback
non-static) by passing disk size as 2nd parameter instead of the different structures holding the disk size info. The fifth copy of gpt_chk_mbr() in fdisk is a little specialer. No functional change.
2015-12-23pledge "audio" code block must be !SMALL_KERNELTheo de Raadt
2015-12-23revert previous:Jasper Lievisse Adriaanse
---------------------------------------------------------------------- revision 1.961 date: 2015/12/22 13:33:26; author: sashan; state: Exp; lines: +153 -44; commitid: oBRhtWcDV0ThviVT; - yet another tiny step towards MP PF. This time we need to make sure statekey attached to packet stays around, while accepted packet is routed through IP stack. OK mpi@, henning@ ---------------------------------------------------------------------- there have been multiple reports of KASSERT(!pf_state_key_isvalid(sk)) being triggered without much effort, so back this out for now.
2015-12-23If PLEDGE_AUDIO is set, allow audio(4) ioctls necessaryAlexandre Ratchov
to use raw audio devices. ok deraadt, semarie
2015-12-23One "sbar" taskq is enough.Mark Kettenis
ok visa@
2015-12-22spliting -> splittingmmcc
2015-12-22Re-add config includesStefan Fritsch
These got lost in previous commit. This broke ppp, nmea, msts, endrun. Found the hard way by David Coppa
2015-12-22- yet another tiny step towards MP PF. This time we need to make sureAlexandr Nedvedicky
statekey attached to packet stays around, while accepted packet is routed through IP stack. OK mpi@, henning@
2015-12-21Move ppp, nmea, endrun, and msts prototypes to tty.hStefan Fritsch
Fix inconsistent arguments for pppopen/pppclose/pppstart. Use passed in argument p in pppopen instead of curproc. "Looks good to me" deraadt@
2015-12-20size for free, sent and reminded by Mathieu. also delete null check.Ted Unangst
2015-12-20Simple free(9) sizes, from Matthieu <naabed AT poolp DOT org>.Martin Pieuchot