summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
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@
2019-01-31Implement booting from softraid on arm64. This consists of creating aPatrick Wildt
list of available block devices, so we can also boot from another block device than the one that efiboot was loaded from. Softraid will then create a list of volumes by checking the partition table for RAID and matching softraid metadata. If efiboot was loaded from the same physical drive as a softraid volume, it will use the soft- raid volume as boot device and it will ask you to unlock it. The UUID and key of that boot volume will be passed as FDT properties to the kernel. Those FDT properties will be zeroed explicitly by the kernel after they have been passed to the softraid stack. ok kettenis@
2019-01-31Enable IQ/ADC calibration in the athn(4) driver.Stefan Sperling
Code for this was already present, it was just not being called yet. Tested on AR9280 and AR9271 by jmc@, kevlo@, jmatthew@, juanfra@, and myself.
2019-01-31remove remnant of jackportTed Unangst
2019-01-31tc_setclock: Don't rewind the system uptime during resume/unhibernate.cheloha
When we come back from suspend/hibernate the BIOS/firmware/whatever can hand us *any* TOD, so we need to check that the given TOD doesn't set our boot offset backwards, breaking the monotonicity of e.g. CLOCK_MONOTONIC. This is trivial to do from the BIOS on most PCs before unhibernating. There might be other ways it can happen, accidentally or otherwise. This is a bit messy but it can be made prettier later with a "bintimecmp" macro or something like that. Problem confirmed by jmatthew@. "you are very likely right" deraadt@
2019-01-31use "sc" as the name of the softc variable in the ioctl code too.David Gwynne
while there, assign int when declaring the sc variable so the ioctl paths do less.
2019-01-30Replace hand rolled linked list with TAILQ. All made possible by the recentanton
introduction of struct lockf_state. ok bluhm@ visa@
2019-01-30Make bwfm(4) query firmware for RSSI levels and current transmit rate whenStefan Sperling
ifconfig asks for such information. ok patrick@
2019-01-30use MPLS_SHIM2LABEL and MPLS_LABEL2SHIMDavid Gwynne
2019-01-30add some macros to help turn labels into shims and back again.David Gwynne
2019-01-30dont store the unit when creating the interface, it's never usedDavid Gwynne
2019-01-29check the result of rtalloc with rtisvalid instead of a compare with NULLDavid Gwynne
based on advice seen from mpi@
2019-01-29Enable CRYPTO for arm64 RAMDISK so that we can use softraid crypto.Patrick Wildt
ok deraadt@
2019-01-29Discard unwanted mouse events from the keyboard input channel when we'reMarcus Glocker
on the console. Issue reported by deraadt@. ok deraadt@, mpi@
2019-01-29Plumbing to simplify upcoming locking.Martin Pieuchot
- Do checks that do not access shared data structures first, they don't need locking and save us some dances. - Use the common !ETHER_IS_MULTICAST() idiom and move some code that won't be executed if the bridge(4) is down. ok bluhm@, visa@
2019-01-29Add a dedicated sysctl(2) node for witness(4).Visa Hankala
The new node contains the subsystem's main control variable, kern.witness.watch. It is aliased by the old name, kern.witnesswatch. The alias will be removed in the future. OK anton@ mpi@
2019-01-29Accept control frames in monitor mode.Kevin Lo
Based on a diff from Jesper Wallin. ok jmatthew@, stsp@
2019-01-29call the "parent" interface ifp0 to be consistent with other drivers.David Gwynne
2019-01-29use a sockaddr_mpls when preparing an AF_MPLS sockaddr for mpls_outputDavid Gwynne
2019-01-29ixl works fine on sparc64David Gwynne
ok deraadt@ jmatthew@
2019-01-29get rid of some more debug printfsDavid Gwynne
suggested by jmatthew@
2019-01-29don't need to print the base queue number.David Gwynne
ok jmatthew@
2019-01-28Simplify by using `spc' since we already have it, no behavior change.Martin Pieuchot
2019-01-28Stop accounting/updating priorities for Idle threads.Martin Pieuchot
Idle threads are never placed on the runqueue so their priority doesn't matter. This fixes an accounting bug where top(1) would report a high CPU usage for Idle threads of secondary CPUs right after booting. That's because schedcpu() would give 100% CPU time to the Idle thread until "real" threads get scheduled on the corresponding CPU. Issue reported by bluhm@, ok visa@, kettenis@
2019-01-28Implement breaking into ddb on imxuart(4). When a break is detected,Patrick Wildt
a flag in the upper byte of the 2-byte-wide receive register is set. ok kettenis@
2019-01-28get rid of unused globalDavid Gwynne
2019-01-28fix mpe_start by if_put()ting the right ifpDavid Gwynne
shuffle mpe_output while here.