summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2019-02-13Allow SO_PEERCRED to be called on sockets created with socketpair.Martijn van Duren
OK claudio@ and jca@
2019-02-12Add Allwinner V3s support. From SASANO Takayoshi.Mark Kettenis
2019-02-11In ddb add description for show mbuf flags bit SYNCOOKIE_RECREATEDAlexander Bluhm
of struct pkthdr_pf. from Jan Klemkow
2019-02-11add M_CANFAIL to malloc, and return ENOMEM if allocating an interfaceDavid Gwynne
fails.
2019-02-10assign the m_prepend result to the right variable.David Gwynne
2019-02-10revert revert revert. there are many other archs that use custom allocs.Ted Unangst
2019-02-10whitespace tweak, no functional changeDavid Gwynne
2019-02-10get rid of the global list of mpe interfaces, it's not needed anymoreDavid Gwynne
mpe would try to detect label collisions itself, but wasn't coordinating with mpw or other labels, making it's solution incomplete. this also means i won't need extra locking if i try to make the ioctl paths mpsafe.
2019-02-10remove the implict RTF_MPATH flag that rt_ifa_add() sets on new routes.David Gwynne
MPLS interfaces (ab)use rt_ifa_add for adding the local MPLS label that they listen on for incoming packets, while every other use of rt_ifa_add is for adding addresses on local interfaces. MPLS does this cos the addresses involved are in basically the same shape as ones used for setting up local addresses. It is appropriate for interfaces to want RTF_MPATH on local addresses, but in the MPLS case it means you can have multiple local things listening on the same label, which doesn't actually work. mpe in particular keeps track of in use labels to it can handle collisions, however, mpw does not. It is currently possible to have multiple mpw interfaces on the same local label, and sharing the same label as mpe or possible normal forwarding labels. Moving the RTF_MPATH flag out of rt_ifa_add means all the callers that still want it need to pass it themselves. The mpe and mpw callers are left alone without the flag, and will now get EEXIST from rt_ifa_add when a label is already in use. ok (and a huge amount of patience and help) mpi@ claudio@ is ok with the idea, but saw a much much earlier solution to the problem
2019-02-10missed a file. add flags to the pool page free function.Ted Unangst
2019-02-10if waitok flag is set, have the interrupt multipage allocator redirectTed Unangst
to the not interrupt allocator.
2019-02-10make it possible to reduce kmem pressure by letting some pools use a moreTed Unangst
accomodating allocator. an interrupt safe pool may also be used in process context, as indicated by waitok flags. thanks to the garbage collector, we can always free pages in process context. the only complication is where to put the pages. solve this by saving the allocation flags in the pool page header so the free function can examine them. not actually used in this diff. (coming soon.) arm testing and compile fixes from phessler
2019-02-10"non-existant" is one of those words that don't exist, so use "non-existent"Peter Hessler
instead From Pamela Mosiejczuk, many thanks! OK phessler@ deraadt@
2019-02-10Add Allwinner V3s support. Also update some Allwinner A80 pin names toMark Kettenis
what is used by more recent Linux kernels. Partly from SASANO Takayoshi.
2019-02-10Handle "broken-cd" as "non-removable" for now. This will generate someMark Kettenis
error messages if a card is absent from the slot, but other workarounds are much more complicated. From SASANO Takayoshi.
2019-02-09major() and minor() are documented as returning unsigned, so do soPhilip Guenther
ok deraadt@
2019-02-09vmm(4): add a debug printf when processing vmxon operationsMike Larkin
2019-02-08fix ipv4 checksum fixup; this trick requires an accumulator of exactly twice ↵Richard Procter
the checksum's width ok dlg@
2019-02-08Fix kernel info leak in routing message.Alexander Bluhm
from NetBSD; OK deraadt@ visa@
2019-02-08Fix stack info leak in execve(2). There are 2x4 bytes of paddingAlexander Bluhm
in struct ps_strings. from NetBSD; OK deraadt@ guenther@ visa@
2019-02-07Add lock stack trace saving for witness(4).Visa Hankala
This lets witness(4) save a stack trace on each lock acquisition. The saved traces can be viewed in ddb(4) when showing the currently held locks, which may help when debugging incorrect locking. Sample output: ddb{0}> show all locks Process 63836 (rm) thread 0xffff8000221e52c8 (435004) exclusive rrwlock inode r = 0 (0xfffffd8119a092c0) locked @ /usr/src/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x419 #1 _rw_enter+0x2bb #2 _rrw_enter+0x42 #3 VOP_LOCK+0x3f #4 vn_lock+0x36 #5 vfs_lookup+0xa1 #6 namei+0x2b3 #7 dounlinkat+0x85 #8 syscall+0x338 #9 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 1 (0xffffffff81e6a5f0) locked @ /usr/src/sys/arch/amd64/amd64/intr.c:525 #0 witness_lock+0x419 #1 syscall+0x2b6 #2 Xsyscall+0x128 The saving adds overhead, so it is not enabled by default. It can be taken into use by setting sysctl kern.witness.locktrace=1 at runtime or by defining WITNESS_LOCKTRACE in the kernel configuration. Feedback and OK anton@
2019-02-07Consistently use m_freem(9). This fixes possible leaks in a fewPatrick Wildt
error cases.
2019-02-07There's a task ring for executing commands in a sleep-safe context.Patrick Wildt
This task is used to deliver mbufs (for events, not data), but it's possible that the queue overruns. In that case it does leak mbufs. For now, assert the size to see if we hit the issue.
2019-02-06Rework fec(4). I have written this driver in 2012 as my first everPatrick Wildt
ethernet controller driver. Handling of descriptors and buffers has not been great. There was no way to recover from a full tx queue. This introduces a mechanism akin to dwxe(4) and tsec(4) and fixes that. On rd we now map mbufs directly. On tx we can do that as well for newer SoCs. The i.MX6 Q/DL generation still needs a bounce buffer on tx for proper alignment. Tested with bluhm on Cubox-i (armv7) and Hummingboard Pulse (arm64)
2019-02-06Fix a possible mbuf leak in tcp_usrreq(). Make the error handlingAlexander Bluhm
more consistent to the other protocols' usrreq functions. OK visa@ claudio@
2019-02-06Use ktrreltimespec() as the timeout is relative, pointed by matthew@.Martin Pieuchot
ok cheloha@
2019-02-04Avoid an mbuf double free in the oob soreceive() path. In theAlexander Bluhm
usrreq functions move the mbuf m_freem() logic to the release block instead of distributing it over the switch statement. Then the goto release in the initial check, whether the pcb still exists, will not free the mbuf for the PRU_RCVD, PRU_RVCOOB, PRU_SENSE command. OK claudio@ mpi@ visa@ Reported-by: syzbot+8e7997d4036ae523c79c@syzkaller.appspotmail.com
2019-02-04Make callers of witness_lock_list_{get,free}() responsible of raisingVisa Hankala
the system priority level to IPL_HIGH. This simplifies the code a bit relative to calling from witness_lock() and witness_unlock(). OK mpi@
2019-02-04Turns out we do need to handle control messages that exceed MLEN, soMark Kettenis
allocate a cluster if the message is larger than that. Fixes a panic on shutdown on my Asus X205TA. ok patrick@, stsp@
2019-02-04When freeing the sem_undo structure in semundo_adjust(), update theanton
caller supplied pointer. Otherwise, the caller is left with a dangling pointer that could lead to a use-after-free panic. ok millert@ visa@ Reported-by: syzbot+ac1d7685deab53b95ace@syzkaller.appspotmail.com Reported-by: syzbot+dbe8f002f8051f26f6fe@syzkaller.appspotmail.com
2019-02-03let tun read AF_MPLS packets from userland.David Gwynne
2019-02-03Add mvgicp(4), a driver for the Marvell extension to the GIC thatPatrick Wildt
allows triggering SPI interrupts by doing memory transactions. This was already partially implemented in mvicu(4) and is now outsourced into its own driver since we need better initialization when booting using u-boot. Also implement new and legacy bindings in mvicu(4), relying on the new mvgicp(4) driver. ok kettenis@
2019-02-03enable -msave-args when building with clang.David Gwynne
this allows us to provide actual arguments in functions in ddb traces. deraadt@ helped me figure out that a new clang has been in snaps for days now, so it's easy for people to get a new compiler if they're building current.
2019-02-03Always refault if relocking maps fails after IO. This fixes a regressionVisa Hankala
introduced with __MAP_NOFAULT. The regression let uvm_fault() run without proper locking and rechecking of state after map version change if page zero-fill was chosen. OK kettenis@ deraadt@ Reported-by: syzbot+9972088c1026668c6c5c@syzkaller.appspotmail.com
2019-02-03Delete cases in kerntrap() that just jump to the default casePhilip Guenther
ok mlarkin@
2019-02-02Improve stack trace saving on i386:Visa Hankala
* Replace unnecessary use of db_get_value() with direct access of f_retaddr. The trace function assumes that the chain of frames is good in terms of alignment and content. * Replace the for loop with a while loop and drop the check "frame != NULL" from the loop condition. The check is redundant with the "!INKERNEL(frame)" condition. The code already assumes that the initial frame is valid. * Stop iteration if f_retaddr is a non-kernel address in order to not save a user address at the end of the trace. This additionally fixes a kernel crash that would happen if the user thread had a broken frame pointer. OK mpi@
2019-02-02Improve stack trace saving on amd64:Visa Hankala
* Replace unnecessary use of db_get_value() with direct access of f_retaddr. The trace function assumes that the chain of frames is good in terms of alignment and content. * Replace the for loop with a while loop and drop the check "frame != NULL" from the loop condition. The check is redundant with the "!INKERNEL(frame)" condition. The code already assumes that the initial frame is valid. * Stop iteration if f_retaddr is a non-kernel address in order to not save a user address at the end of the trace. This additionally fixes a kernel crash that would happen if the user thread had a broken frame pointer. * Fix erroneous skipping of the second stack frame. OK mpi@
2019-02-01Properly account wired pages in pmap_randomize_levelMike Larkin
This change fixes a regress test failure noticed by bluhm@. ok deraadt
2019-02-01free size for wscons_event; ok deraadt@ visa@anton
2019-02-01Complete athn(4) noisefloor calibration code and enable it.Stefan Sperling
Update default/min/max noisefloor values to those used by Linux ath9k. Tested by jmc, juanfra, kn, and myself, on 9280 and 9271 devices.
2019-02-01Export per-TDB counters to userland.Martin Pieuchot
This time add the counter extention to SADB_GET's whitelist. ok bluhm@, visa@
2019-02-01Do not silently return if extensions do not match the filters.Martin Pieuchot
ok bluhm@, visa@
2019-02-01Print xhci version in hex, from sc.dying at gmail.Martin Pieuchot
2019-02-01make m_pullup use the first mbuf with data to measure alignment.David Gwynne
this fixes an issue found by a regress test on sparc64 by claudio, and between us took about half a day of work to understand and fix at a2k19. ok claudio@
2019-02-01In wskbdclose(), use the same logic as in wskbdopen() to determine ifanton
the device was opened in write-only mode. Relying on me_evar being NULL does not work if the wskbd device was opened first followed by opening a wsmux device. Closing the wskbd device first at this stage would cause the wscons_event queue inherited from the wsmux device to be freed. This in turn could cause a panic if an ioctl(WSMUXIO_INJECTEVENT) command is issued to the wsmux device. ok deraadt@ visa@ Reported-by: syzbot+ed88256423ae8d882b8b@syzkaller.appspotmail.com
2019-02-01fix up calculation of our physical function id, making the second portJonathan Matthew
on dual port cards work much better. ok dlg@
2019-02-01Fix lost interrupts in fec(4). Apparently the tick that talks to thePatrick Wildt
phy to check the media status did not only ack the MII interrupt, but also all the others. Thus it could happen that the TX completion was not seen by the interrupt handler, leading to full TX queues. Also, the fec(4) interrupt handler acked more than it handles, thus possibly also acking the MII interrupt. Found with bluhm@ on his new arm64 regression setup. ok bluhm@
2019-01-31Bump version number to be able to distinguish bootloaders with softraidMark Kettenis
support.
2019-01-31matthew noticed that some clocks use tfind() which is not mpsafe.Ted Unangst
add locking in clock_gettime where needed. ok cheloha matthew
2019-01-31Fix compilation of amd64 kernel when optimization is disabled.Todd C. Miller
C99 inline semantics resulted in undefined symbols. OK deraadt@ mpi@ dlg@