summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2018-10-04Force 8051 reset/enable before waiting for firmware to get ready forKevin Lo
RTL8723AE, like we alreay do for RTL8188C/RTL8192C. ok jmatthew@
2018-10-03Fix a race condition that affects pfsync interface deletion.Visa Hankala
When a pfsync interface is being deleted, all its timeout handlers and pfsync_send_dispatch() have to stop accessing the software context before the context is freed. Ensure sufficient synchronization by acquiring NET_LOCK() and clearing `pfsyncif' inside the critical section in pfsync_clone_destroy(). When a timeout handler has entered the critical section, it has to check `pfsyncif' and bail out if the value is NULL. pfsync_send_dispatch() already does this check. Issue reported and fix tested by Hrvoje Popovski. OK mpi@ bluhm@
2018-10-02- pfsync: avoid a recursion on PF_LOCKAlexandr Nedvedicky
OK bluhm@
2018-10-02Unify the MD byteswapping code as much as possible across architectures.Christian Weisgerber
Use inline functions instead of GNU C statement expressions, and make them available to userland. With clues from guenther@. ok guenther@ kettenis@
2018-10-02Make some USB ioctls return ENXIO, instead of EIO, if usbd_is_dying().Stefan Sperling
Brings us one step closer towards making this condition's error code consistent across all USB drivers. Patch by Moritz Buhl ok mpi@ bluhm@
2018-10-02Add support for RT3290 chipset by James Hastings.Kevin Lo
Tested by me and James Hastings.
2018-10-01add RTL8723AE supportJonathan Matthew
ok kevlo@ stsp@
2018-10-01Allow DIOCRGETADDRS when securelevel(7) > 1kn
This fixes certain operations such as `pfctl -t foo -T show' when the system is in "Highly secure mode". `pfctl -t foo -T show -v' would already work due to a different ioctl (DIOCRGETASTATS) being used. Reported by Zbyszek Żółkiewski, thanks! OK sthen sashan
2018-10-01Use inline functions instead of GNU C statement expressions for the MDChristian Weisgerber
byteswapping code. ok guenther@ kettenis@ This fixes a corner case triggered by the comms/hylafax port where htons() can't be compiled in C++ code: "Don't know how to handle indirect register inputs yet for constraint 'r'"
2018-10-01Put bridge_input & output back under the KERNEL_LOCK().Martin Pieuchot
Wireless drivers call if_enqueue() out of the NET_LOCK() so it cannot be used to serialize bridge(4) states. Found by stsp@, ok visa@
2018-10-01regenJonathan Matthew
2018-10-01add RTL8723AEJonathan Matthew
2018-10-01The sequence number field in the 802.11 frame header includes the sequenceJonathan Matthew
number and the fragment number, so shift it to get just the sequence number for the tx descriptor. While here, add a #define for the flag in the same field that enables hardware sequence numbering, and use existing constants for some R92C_RSV_CTRL writes. prompted by feedback from kevlo@ on another diff, tested on 8188CE, EE, EU ok stsp@ kevlo@
2018-09-30Delete the reserve_dumppages() declaration, missed in its 2010 removalPhilip Guenther
ok deraadt@
2018-09-29unmark -beta. There is still development happening, and we aren'tTheo de Raadt
locked in stone yet, but the clock starts ticking...
2018-09-29Use atomic operations to update vfc_refcount. Change the field's typeVisa Hankala
to unsigned int. OK deraadt@
2018-09-28Add vlan and trunk to arm64's RAMDISK (amd64 parity)ccardenas
OK deraadt@ and kettenis@
2018-09-28Move the unions into the rom struct which fixes Coverity CID 1473649 andKevin Lo
makes it more readable. ok stsp@ and jmatthew@
2018-09-27Coherently name "struct bridge_iflist" variables `bif'.Martin Pieuchot
ok visa@
2018-09-27Make sure the L2 entry is cloned before dereferencing its parent.Martin Pieuchot
RTF_LOCAL entries or static ARP entries don't have parents, so the logic was incorrect. Note that it might be possible to extend the logic to work with non-cloned L2 entries but the few use cases do not justify the complexity (yet). Problem reported & fix tested by Elie Bouttier. ok bluhm@, visa@, claudio@
2018-09-26KERN_CPTIME2: set ENODEV if the CPU is offline.cheloha
This lets userspace distinguish between idle CPUs and those that are not schedulable because hw.smt=0. A subsequent commit probably needs to add documentation for this to sysctl.2 (and perhaps elsewhere) after the dust settles. Also included here are changes to systat(1) and top(1) that account for the ENODEV case and adjust behavior accordingly: - systat(1)'s cpu view prints placeholder marks ('-') instead of percentages for each state if the given CPU is offline. - systat(1)'s vmstat view checks for offline CPUs when computing the machine state total and excludes them, so the CPU usage graph only represents the states for online CPUs. - top(1) does not draw CPU rows for offline CPUs when the view is redrawn. If CPUs "go offline", percentages for each state are replaced by placeholder marks ('-'); the view will need to be redrawn to remove these rows. If CPUs "go online" the view will need to be redrawn to show these new CPUs. In "combined CPU" mode, the count and the state totals only represent online CPUs. Ports using KERN_CPTIME2 will need to be updated. The changes described above to make systat(1) and top(1) aware of the ENODEV case *and* gracefully handle a changing HW_NCPUONLINE while the application is running are not necessarily appropriate for each and every port. The changes described above are so extensive in part to demonstrate one way a program *might* be made robust to changing CPU availability. In particular, changing hw.smt after boot is an extremely rare event, and this needs to be weighed when updating ports. The logic needed to account for the KERN_CPTIME2 ENODEV case is very roughly: if (sysctl(...) == -1) { if (errno != ENODEV) { /* Actual error occurred. */ } else { /* CPU is offline. */ } } else { /* CPU is online and CPU states were set by sysctl(2). */ } Prompted by deraadt@. Basic idea for ENODEV from kettenis@. Discussed at length with kettenis@. Additional testing by tb@. No complaints from hackers@ after a week. ok kettenis@, "I think you should commit [now]" deraadt@
2018-09-26Fix controller name.Visa Hankala
2018-09-26Move the allocating and freeing of mount points intoVisa Hankala
dedicated functions. OK deraadt@ mpi@
2018-09-26Move bridge input/output paths outside of the KERNEL_LOCK().Martin Pieuchot
Tested by Hrvoje Popovski who measured a 30% improvement of forwarded packets in the best case. ok visa@
2018-09-26Increase the timeout from previous commit further. Rather than warningTheo de Raadt
we have spun out (to which there are consequences), we should spin longer. The BSP really wants the APs to finish.
2018-09-25fix typo in commentJasper Lievisse Adriaanse
ok beck@
2018-09-25Insert a workaround for per-ifp ioctl being called w/o NET_LOCK().Martin Pieuchot
An example of such code path is vlan_destroy() where we don't want to grab the lock because this driver is already NET_LOCK()-free. The real solution to this problem is to stop holding the NET_LOCK() around driver *_ioctl() routines. Problem reported & fix tested by Élie Bouttier, ok visa@, bluhm@
2018-09-24Prevent ieee80211_get_txkey() from returning the integrity group temporalStefan Sperling
key (IGTK) if a node doesn't have management frame protection (MFP) enabled. The IGTK is not initialized if MFP is disabled, so using it triggers this panic in ieee80211_encrypt(): panic("invalid key cipher 0x%x", k->k_cipher) (As far as I can tell, at present, MFP is never enabled.) Problem reported and fix tested by tj@ on athn(4) hostap
2018-09-24Turn carp_ourether() mp-safe, this is a requirement for taking bridge(4)Martin Pieuchot
out of the KERNEL_LOCK(). ok visa@, bluhm@
2018-09-24Add "Spleen 5x8" to wsfont, a font targetted at small OLED displaysFrederic Cambus
to be used with devices handled by ssdfb(4). It contains all printable ASCII characters (96 glyphes). The font is 2-Clause BSD licensed and is my original creation. OK patrick@
2018-09-22Remap the UEFI buffer early such that we can use a write combining mappingMark Kettenis
which speeds things up considerably compared to an uncached mapping. ok deraadt@
2018-09-22Only clear the character backing store when the RI_CLEAR flag is set.Mark Kettenis
ok deraadt@
2018-09-22Back out the following if_iwm.c revisions:Stefan Sperling
r1.232 Fix length checks in the receive path of iwm(4) r1.230 Add monitor mode support to iwm(4) r1.229 Implement Rx of multiple frames per interrupt in the iwm(4) driver There is an apparent block-ack problem (base.tgz takes 8 hours to download) which goes away when these changes are reverted. To be revisited after release. ok deraadt@
2018-09-22Enable USB bwfm(4) on macppc RAMDISK as well, matching GENERIC.Stefan Sperling
Passes 'make release' build.
2018-09-22Harmonize spacing after ellipses in displayed messages.Frederic Cambus
We were using spacing after ellipses in an inconsistent way in the installer. Standardize on using "... " everywhere and take into account the cursor position while we are waiting for the task to complete: the cursor is now always positioned after the last dot, and the space is added when displaying completion confirmation. While there, also take cursor position into account in vfs_shutdown(), and remove the extra leading space before ticks in dhclient. OK deraadt@
2018-09-21Enable bwfm(4) in GENERIC on macppc.Stefan Sperling
Tested by Christian Hammerschmidt.
2018-09-21Add support for RTL8188EE.Jonathan Matthew
This needs a new firmware image, which should be added to the rtwn firmware package shortly. testing and lots of help from kevlo@ ok kevlo@ stsp@
2018-09-20As a step towards per inpcb or socket locks, remove the net lockAlexander Bluhm
for netstat -a. Introduce a global mutex that protects the tables and hashes for the internet PCBs. To detect detached PCB, set its inp_socket field to NULL. This has to be protected by a per PCB mutex. The protocol pointer has to be protected by the mutex as netstat uses it. Always take the kernel lock in in_pcbnotifyall() and in6_pcbnotify() before the table mutex to avoid lock ordering problems in the notify functions. OK visa@
2018-09-20grow alpha and hppa media to accomodate some recent growthTheo de Raadt
2018-09-20vmm(4): Clear the guest MWAITX/MONITORX extended CPUID feature bit,Bryan Steele
like we already do for MWAIT/MONITOR. Also match Intel here by not exposing the SVM capability to AMD guests. Allows Linux guests to boot in vmd(8) on Ryzen CPUs. ok mlarkin@
2018-09-20fix a memory leak in ihidev_hid_command()Jonathan Gray
ok claudio@
2018-09-19Always call bridge_iflist `bif'.Martin Pieuchot
ok bluhm@, visa@
2018-09-19Report duplex state correctly for adapters with firmware interface versionsJonathan Matthew
older than 1.08. tested by and ok ccardenas@
2018-09-19Free edid_buf after use so to fix possible memory leak.Claudio Jeker
With and ok jsg@
2018-09-19In mue_iff() move the initialization of the hash table up so that is doneRicardo Mestre
unconditionally, like it's done on other devices, so that we don't end up in the situation of the card being put in promiscuous mode or if ac->ac_multirangecnt > 0 and then we would write into the table while being uninitialized a little bit later. Noticed on Coverity ID 1473316. hint from claudio@ and kettenis@ OK kevlo@ claudio@
2018-09-19Delete checks of the CST bit_width ('vendor') field, as new Ryzen machinesPhilip Guenther
are showing up with vendor 2 and it doesn't seem to mean anything: Linux doesn't check it at all, so this exhibits all the normal ACPI spec lossage tested in snaps for a few weeks shrug kettenis@
2018-09-18Updating time counters without memory barriers is wrong. PutAlexander Bluhm
membar_producer() into tc_windup() and membar_consumer() into the uptime functions. They order the visibility of the time and generation number updates. This is a combination of what NetBSD and FreeBSD do. OK kettenis@
2018-09-18whitespace fix; no binary changeanton
2018-09-18vmm(4): Reset host LDTR on exit for SVMMike Larkin
For SVM machines, the LDT content remains set to that of the guest VM on exit (as compared to Intel/VMX which resets the LDTR to 0). This fix ensures the LDT is reset to 0 on SVM exits. Leaving the LDT set to the guest's choice could allow a malicious process to escalate its privileges with the help of a malicious VM that they also are able to run on the machine. This was reported by Maxime Villard; thanks!
2018-09-18grow arm64 ramdiskTheo de Raadt