summaryrefslogtreecommitdiffstats
path: root/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Push kernel lock within rtable_add(9) and rework it to return 0 in themvs2021-03-262-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | case when requested table is already exists. Except initialization time, route_output() and if_createrdomain() are the only paths where we call rtable_add(9). We check requested table existence by rtable_exists(9) and it's not the error condition if the table exists. Otherwise we are trying to create requested table by rtable_add(9). Those paths are kernel locked so concurrent thread can't create requested table just after rtable_exists(9) check. Also rtable_add(9) has internal rtable_exists(9) check and in this case the table existence assumed as EEXIST error. This error path is never reached. We are going to unlock PF_ROUTE sockets. This means route_output() will not be serialized with if_createrdomain() and concurrent thread could create requested table. Table existence check and creation should be serialized and it makes sense to do this within rtable_add(9). This time kernel lock is used for this so it pushed down to rtable_add(9). The internal rtable_exists(9) check was modified and table existence is not error now. Since the external rtable_exists(9) check is useless it was removed from if_createrdomain(). It still exists in route_output() path because the logic is more complicated here. ok mpi@
* Push kernel lock down to rt_setsource() to make `ifa' dereference safe.mvs2021-03-261-3/+10
| | | | | | | | | | | Netlock doesn't make sense here because ifa_ifwithaddr() holds kernel lock while performs lists walkthrough. This was made to decrease the future diff for PF_ROUTE sockets unlocking. This time kernel lock is still held while we perform rt_setsource(). ok mpi@
* Initialize error variable in dtread().bluhm2021-03-261-2/+2
| | | | OK mpi@
* Only install route with label, fix route leak on destroykn2021-03-263-3/+15
| | | | | | | | | | | | | | | | | | | | | ifconfig mp* mplslabel N" validates the label both in ifconfig(8) and each driver's ioctl handler, but there is one case where all drivers install a route without looking at the label at all. SIOCSLIFPHYRTABLE in all three drivers just validates the rdomain and sets the label to itself (0) such that the route is (re)installed accordingly. None of the driver's helper functions dealing with labels and routes validate labels themselves but instead expect the callees, e.g. the ioctl handler to do so. That means we can install routes for the explicit NULL label in non-default routing tables but are never able to clean them up without reboot. Fix this by adding the inverse of mp*_clone_destroy()'s label check to the routines installing the MPLS route to avoid bogus ones in the first place. OK claudio
* Remove parenthesis around return value to reduce the diff with NetBSD.mpi2021-03-2613-176/+176
| | | | | | No functional change. ok mlarkin@
* Fix wrong sequence number wrap in ieee80211_recv_auth().stsp2021-03-261-2/+2
| | | | | IEEE 802.11 sequence numbers wrap around at 0xfff, not 0xffff. ok phessler@ kevlo@
* regenjan2021-03-261-1/+5
|
* Add PCI ID for Intel X710 10G SFP+ NICjan2021-03-261-1/+2
| | | | ok patrick@
* regenjan2021-03-261-1/+2
|
* Add missing PCI ID for Intel X710 SFP+ NICjan2021-03-261-1/+2
| | | | ok patrick@
* Permit kern.somaxconn when the unix pledge is used. Previously this was onlyabieber2021-03-251-2/+2
| | | | | | | | | | allowed when inet was used. This lets Go programs use 'unix' without also including 'inet'. from Josh Rickmar ok / tree review from deraadt@, commit message cluestick from tb@
* an invalid value of `mcs' may come from the hardware so adjust code so that themestre2021-03-251-2/+3
| | | | | | | | value is only used after checking if it's valid or not. CID 1502921 OK stsp@ phessler@
* Provide apm(4/arm64) with battery informationkn2021-03-251-1/+41
| | | | | | | | | | | | | | | | | | | | | | apm merely provides an all zero/unknown stub for those values, e.g. apm(8) output is useless. Hardware sensors however provide this information: hw.sensors.cwfg0.volt0=3.76 VDC (battery voltage) hw.sensors.cwfg0.raw0=259 (battery remaining minutes) hw.sensors.cwfg0.percent0=58.00% (battery percent) Make cwfg(4) copy those over using apm_setinfohook() for apm to show it: Battery state: high, 58% remaining, 259 minutes life estimate A/C adapter state: not known Performance adjustment mode: auto (408 MHz) In cwfg's update routine, to keep values coherent, always reset them to zero/unknown and only set those that came from a valid reading. Input OK jca
* remove uneeded includes in md armv7 filesjsg2021-03-2569-307/+71
| | | | based on include-what-you-use suggestions
* syncsthen2021-03-242-6/+6
|
* remove vendor name (Dell) repeated in product namesthen2021-03-241-2/+2
|
* Improve the tap detection mechanism.bru2021-03-241-12/+21
| | | | | | | | | Revision 1.29 of wstpad.c has removed the 'maxdist' checks for multi-finger taps. While this change makes tap detection more reliable, and does not affect inputs intended for pointer movement, it might interfere with short scroll gestures. This version reorganizes the filtering code, and reintroduces a weaker version of those checks for MT touchpads.
* cd9660, mfs: do not hide generic vop functions behind #definesemarie2021-03-243-31/+15
| | | | | | | | It makes clearer which vop functions are real fileystem-implementations and which one are only stubs. No functional changes are intented. ok visa@
* make some `struct vops' members explicitly NULL instead of implicitly NULLsemarie2021-03-243-4/+8
| | | | ok mpi@
* The logic in mmrw() to check whether an address is within directbluhm2021-03-241-4/+4
| | | | | | | | | | | | | map was the wrong way around. The && prevented an EFAULT error and could pass userland addresses as kernel source to copyout(9). The kernel could crash with protection fault due to an invalid offset when reading /dev/kmem. Also make the range checks stricter. Not only the start address must be valid, but also the end address must be within the region to be copied. Note that sysctl kern.allowkmem=0 makes the bug unreachable by default. OK deraadt@
* Make tap detection less restrictive for multi-finger taps.bru2021-03-241-9/+3
| | | | | | | | | In order to distinguish tap gestures from short movements, the mechanism checks whether the distance between the first and the last position of a touch exceeds the 'maxdist' limit. Some touchpads provide unreliable coordinates when more than one contact is being made simultaneously, and in this case the filter may be too strong - and superfluous, because only one-finger contacts should trigger pointer movement.
* Define a USB quirk for devices that need to keep their pipes open atjcs2021-03-244-14/+63
| | | | | | | | | | | | | | | all times, before the device is enabled and after the device is disabled by wscons. This was originally needed by umt for the Microsoft Surface Type Cover to avoid it resetting (or at least detaching and reattaching) when the touchpad was touched while at the console. A similar problem occurs with the Pinebook Pro's keyboard when switching from X to the console due to the touchpad getting disabled, so add it to ums as well. with and ok kurt
* regenjcs2021-03-242-4/+16
|
* add HAILUCK Keyboardjcs2021-03-241-1/+5
| | | | from kurt
* Fix a corner case bug in Rx block ack window gap-wait timeout handling.stsp2021-03-231-1/+5
| | | | | | | | | | | | | | | If ieee80211_input_ba_flush() was called when there was nothing to flush, the (already pending) gap wait timeout was re-armed. This is only correct if we flush at least one packet. Otherwise packets that arrive at a constant rate of about 4-5 packets per second would extend the gap-wait timeout until the block ack window fills up. In extreme cases this can result in packets being queued for almost 20s. Fix this by returning immediately from ieee80211_input_ba_flush() if the first packet in the reordering buffer is missing. This prevents the timeout from being re-armed. Patch by Christian Ehrhardt. Tested by me on iwm(4) 7265.
* When moving the Rx block ack window forward do not implicitly rely onstsp2021-03-231-2/+3
| | | | | | | | | ieee80211_input_ba_flush() for updating ba->ba_winend. Required for an upcoming ieee80211_input_ba_flush() fix. Patch by Christian Ehrhardt who found one instance of this problem in ieee80211_input_ba_seq(). I spotted another in ieee80211_ba_move_window().
* Make a child execute fork_return() only if PTRACE_FORK has been specified.mpi2021-03-231-3/+6
| | | | | | | | | | fork_return() does an additional check to send a SIGTRAP (for a debugger) but this signal might overwrite the SIGSTOP generated by the parent doing a PT_ATTACH before the child has a change to execute any instruction. Prevent a race visible only on SP system with regress/sys/kern/ptrace2. ok kettenis@
* Skip first frame when saving stacktraces, it's always witness_checkorder().mpi2021-03-231-3/+3
| | | | ok visa@
* Pack the SPCR struct definition since the struct isn't naturally alignedpatrick2021-03-232-4/+4
| | | | | | | or padded, and hence e. g. the access to the PCI vendor/device id would be broken. The structs for the other tables all seem to be packed as well. ok kettenis@
* Now that MSI pages are properly mapped, all that debug code in smmu(4)patrick2021-03-221-34/+2
| | | | | | can be removed. The only thing left to implement for smmu(4) to work out of the box with PCIe devices is to reserve the PCIe MMIO windows. Let's see how we can do this properly.
* Load MSI pages through bus_dma(9). Our interrupt controllers for MSIspatrick2021-03-225-22/+153
| | | | | | | | | | | | | | | | | | | | | | | | | typically pass the physical address, however retrieved, to our PCIe controller code. This physical address can in practise be directly given to the PCIe, but it is not a given that the CPU and the PCIe controller are able to use the same physical addresses. This is even more obvious with an smmu(4) inbetween, which can change the world view by introducing I/O virtual addresses. Hence for this it is indeed necessary to map those pages, which thanks to integration with bus_dma(9) works easily. For this we remember the PCI devices' DMA tag in the interrupt handle during the MSI map, so that we can use the smmu(4)-hooked DMA tag to load the physical address. While some systems might prefer to implement "trapping" pages for MSIs, to make sure devices cannot trigger other devices' interrupts, we only make sure the whole page is mapped. Having the IOMMU create a mapping for each MSI is a bit wasteful, but for now it's the simplest way to implement it. Discussed with and ok kettenis@
* Update device-tree bindingskn2021-03-221-6/+6
| | | | | | | | | | | | | | | | | Using the DTB from our dtb package this driver no longer attaches (on a Pinebook Pro)due to renamed bindings: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml Thanks to kettenis and patrick for pointing this out. Follow upstream's rename and acccount for the monitor interval now being milliseconds not seconds anymore. This makes cwfg(4) export values under hw.sensors as expected when using /usr/local/share/dtb/arm64/rockchip/rk3399-pinebook-pro.dtb . Input patrick kettenis OK kettenis
* Let iwn(4) simply clear frames before the firmware's BA window, insteadstsp2021-03-221-29/+17
| | | | | | | | | | | | | | | | of trying to be smart and clearing already acknowledged frames which are still within the firmware's BA window. This matches what the Linux driver does and makes our driver code simpler. Also, Tx rate control code relies on sequence numbers falling into the BA window so let's skip Tx rate control for frames before this window. Tested by: myself on 6205 and 6300 afresh1, bluhm, and paco on 6300 jmatthew on 5100 Balder Oddson on 6205
* wg(4): fix race between tx/rx handshakes, from Matt Dunwoodie, ok mpi@sthen2021-03-211-5/+4
| | | | | | | | | | | | | | | | "There is a race between sending/receiving handshake packets. This occurs if we consume an initiation, then send an initiation prior to replying to the consumed initiation. In particular, when consuming an initiation, we don't generate the index until creating the response (which is incorrect). If we attempt to create an initiation between these processes, we drop any outstanding handshake which in this case has index 0 as set when consuming the initiation. The fix attached is to generate the index when consuming the initiation so that any spurious initiation creation can drop a valid index. The patch also consolidates setting fields on the handshake."
* Include wstpad allocations when cleaning up wsmouse resources.bru2021-03-213-3/+20
| | | | ok gnezdo@
* Disambiguate expressions.visa2021-03-211-3/+3
|
* makes `struct execsw' to:semarie2021-03-212-6/+12
| | | | | | | - use C99-style initialization (grep works better with that) - use const as execsw is not modified during runtime ok mpi@
* Use uppercases for defines.mpi2021-03-211-6/+6
| | | | | | No functional change. ok semarie@
* RFC 8981 allows the configuration of only temporary IPv6 addresses.florian2021-03-201-4/+8
| | | | | Make the interface come up when the IFXF_AUTOCONF6TEMP is set. OK kn
* namei: reorganize a bit the error path for simples casessemarie2021-03-201-23/+17
| | | | | | | | | | - move 'fail' label to end of function (instead of using the first if-condition) - merge the most simples error code paths idioms from 'cleanup+return' to 'goto-fail' ok mpi@
* Sync some comments in order to reduce the difference with NetBSD.mpi2021-03-209-292/+463
| | | | | | No functionnal change. ok kettenis@
* use m_dup_pkthdr in ip_fragment to copy pkthdr info to fragments.dlg2021-03-201-5/+3
| | | | | | | | this ensures more stuff is copied, in particular the flowid information. this is also how v6 does it, which makes things more consistent. ok bluhm@
* another unfortunate action to cope with relentless kernel growthderaadt2021-03-191-2/+2
|
* When changing the link local address send a RTM_IFINFO message out.claudio2021-03-181-2/+4
| | | | | Also prefer if (error == 0) over if (!error). OK florian@ bluhm@
* Do not call rtm_ifchg() if IFF_UP changed. The code in if_up() and if_down()claudio2021-03-181-3/+6
| | | | | already call rtm_ifchg() and so this would just result in a duplicate message. Noticed by deraadt@. OK florian@ bluhm@
* Like in the sysctl case include the ifp_sadl as RTA_IFP address in RTM_IFINFOclaudio2021-03-181-3/+6
| | | | | | messages. This way userland can detect if the lladdr of an interface was changed. OK florian@ bluhm@
* Fix SIOCDELLABEL/"ifconfig mpe0 -mplslabel" to unset label completelykn2021-03-181-2/+2
| | | | | | | | While the corresponding route gets removed properly, the driver's softc kept the old label, i.e. "ifconfig mpe0" would show "mpls: label 42" instead of "mpls: label (unset)" even though it was unset. OK claudio
* In revision 1.91 of uhidev.c, jcs@ made sure to only detach devicesanton2021-03-183-22/+3
| | | | | claiming multiple report ids once. This allows uhidpp to piggy back on the same functionality making uhidev_unset_report_dev() redundant.
* regenmvs2021-03-184-9/+9
|
* Unlock sendsyslog(2). Console output still requires kernel lock to bemvs2021-03-182-41/+58
| | | | | | | | held but this path is only followed while `syslogf' socket is not set. New `syslogf_rwlock' used to protect `syslogf' access. ok bluhm@