summaryrefslogtreecommitdiffstats
path: root/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* If uhidev_set_report_dev() already have been invoked for the givenanton2021-02-111-4/+6
| | | | | | report id, there's no point in trying to find a matching sub device. ok mglocker@
* Add a instruction barrier between writing CCSELR_EL1 and reading CCSIDR_EL1kettenis2021-02-101-1/+4
| | | | | | | | to guarantee that we read the cache parameters of the cache we just selected. The required ISB instruction is present in the examples in the ARM ARM. Fixes the the report on the cores in Apple's M1 SoC. ok patrick@
* If pf changes the routing table when sending packets, the kernelbluhm2021-02-101-2/+15
| | | | | | | | could get stuck in an endless recursion during TCP path MTU discovery. Create a dynamic host route in ip_output() that can be used by tcp_mtudisc() to store the MTU. Reported by Peter Mueller and Sebastian Sturm OK claudio@
* Interface group names must fit into IFNAMSIZ and be unique. Butbluhm2021-02-101-3/+5
| | | | | | | | | | | | the kernel made the unique check before trunkating with strlcpy(). So there could be two interface groups with the same name. The kif is created by a name lookup. The trunkated names are equal, so there was only one kif owned by both groups. When the groups got destroyed, the single kif was removed twice from the RB tree. Check length of group name before doing the unique check. The empty group name was allowed and is now invalid. Reported-by: syzbot+f47e8296ebd559f9bbff@syzkaller.appspotmail.com OK deraadt@ gnezdo@ anton@ mvs@ claudio@
* Remove `sc_dead' logic from pppac(4). It is used to preventmvs2021-02-101-9/+3
| | | | | | | | | | pppac_ioctl() be called on dying pppac(4) interface. But now if_detach() makes dying `ifp' inaccessible and waits for references which are in-use in ioctl(2) path. This logic is not required anymore. Also if_detach() was moved before klist_invalidate() to prevent the case while pppac_qstart() bump `sc_rsel'. ok yasuoka@
* Move UNIX domain sockets out of kernel lock. The new `unp_lock' rwlock(9)mvs2021-02-103-63/+192
| | | | | | | | used as solock()'s backend to protect the whole layer. With feedback from mpi@. ok bluhm@ claudio@
* Make sure that switching the console from serial to framebuffer workskettenis2021-02-092-22/+25
| | | | | | for framebuffer nodes under / and /chosen. ok patrick@
* pfsync_state_import() must not be called with the pf state lock held,patrick2021-02-091-3/+1
| | | | | | | | | since the actual modification of the state table is done by a call to pf_state_insert(), which takes the pf state lock itself. Other calls to pfsync_state_import() also only have the pf lock. Reported-by: syzbot+d6ea8620b43dc69ecbc6@syzkaller.appspotmail.com ok bluhm@
* ddb: when a new wsdisplay console attaches, resize ddb cols/rows to itjcs2021-02-093-3/+19
| | | | ok visa
* Activate use of PF_LOCK() by removing the WITH_PF_LOCK ifdefs.patrick2021-02-095-42/+5
| | | | | Silence from the network group ok sashan@
* Add a barrier between reading the cqe flags and the command ID, whichjmatthew2021-02-091-1/+3
| | | | | | | | should ensure that we don't read a stale command ID and complete the wrong scsi io. powerpc64 base builds were crashing like this fairly regularly. ok deraadt@ dlg@
* change discipline name from "RAID1C" to "RAID 1C" to match the man pagesstsp2021-02-081-2/+2
|
* Remove maxburst feature from tcp_outputjan2021-02-082-6/+3
| | | | OK bluhm@, claudio@, deraadt@
* Start refcounting interface groups with 1. if_creategroup() returnsbluhm2021-02-082-13/+15
| | | | | | | a new object that is already refcounted, so carp attach does not reach into internal structures. Add kasserts to detect counter overflow or underflow. OK mvs@
* Add a RAID1C (raid1 + crypto) softraid(8) discipline.stsp2021-02-081-0/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RAID1C discipline encrypts data like the CRYPTO discipline, and accepts multiple chunks during creation and assembly like the RAID1 discipline. To deal with failing disks a RAID1C volume may be assembled with a smaller number of chunks than the volume was created with. The volume will then come up in degraded state. If the volume is now detached and assembled again with the correct number of chunks, any re-added chunks will require a rebuild. Consequently, assembling RAID1C volumes requires careful attention to the chunks passed via 'bioctl -l'. If a chunk is accidentally omitted from the command line during volume assembly, then this chunk will need to be rebuilt. At least one known-good chunk is required in order to assemble the volume. Like CRYPTO, RAID1C supports passphrase and key-disk authentication. Key-disk based volumes are assembled automatically if the key disk is present while the system is booting up. Unlike CRYPTO and RAID1, there is no boot support for RAID1C yet. RAID1C largely reuses existing code of RAID1 and CRYPTO disciplines. At present RAID1C's discipline-specific data structure is shared with that of the CRYPTO discipline to allow re-use of existing CRYPTO code. A custom RAID1C data structure would require CRYPTO code to access struct sr_crypto via a pointer instead of via a member field of struct sr_discipline. ok jsing@
* Add a RAID1C (raid1 + crypto) softraid(8) discipline.stsp2021-02-084-32/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RAID1C discipline encrypts data like the CRYPTO discipline, and accepts multiple chunks during creation and assembly like the RAID1 discipline. To deal with failing disks a RAID1C volume may be assembled with a smaller number of chunks than the volume was created with. The volume will then come up in degraded state. If the volume is now detached and assembled again with the correct number of chunks, any re-added chunks will require a rebuild. Consequently, assembling RAID1C volumes requires careful attention to the chunks passed via 'bioctl -l'. If a chunk is accidentally omitted from the command line during volume assembly, then this chunk will need to be rebuilt. At least one known-good chunk is required in order to assemble the volume. Like CRYPTO, RAID1C supports passphrase and key-disk authentication. Key-disk based volumes are assembled automatically if the key disk is present while the system is booting up. Unlike CRYPTO and RAID1, there is no boot support for RAID1C yet. RAID1C largely reuses existing code of RAID1 and CRYPTO disciplines. At present RAID1C's discipline-specific data structure is shared with that of the CRYPTO discipline to allow re-use of existing CRYPTO code. A custom RAID1C data structure would require CRYPTO code to access struct sr_crypto via a pointer instead of via a member field of struct sr_discipline. ok jsing@
* Revert the convertion of per-process thread into a SMR_TAILQ.mpi2021-02-0814-60/+47
| | | | | We did not reach a consensus about using SMR to unlock single_thread_set() so there's no point in keeping this change.
* Do not hold onto the fdplock longer then needed. Release the lock afterclaudio2021-02-081-6/+9
| | | | | | | the initial falloc() calls and then regrab it for the fdinsert() or fdremove() calls respectiviely. Also move closef() outside of the lock. This replaces the previously reverted lock order change that was reverted. OK mvs@ visa@
* Simplify sleep_setup API to two operations in preparation for splittingmpi2021-02-0811-160/+94
| | | | | | | | | | | | the SCHED_LOCK(). Putting a thread on a sleep queue is reduce to the following: sleep_setup(); /* check condition or release lock */ sleep_finish(); Previous version ok cheloha@, jmatthew@, ok claudio@
* 6.9-betaderaadt2021-02-063-9/+9
|
* Simplex interface sends packet back without hardware checksumbluhm2021-02-062-15/+34
| | | | | | | | offloading. The checksum must be calculated in software. Use the same condition in ether_resolve() to send the broadcast packet back to the stack and in in_ifcap_cksum() to force software checksumming. This fixes regress/sys/kern/sosplice/loop. OK procter@
* Revise kernel's ld.script on octeonvisa2021-02-063-13/+56
| | | | | | | | | This allows more control over the structure of the linked kernel image. Now the ELF .openbsd.randomdata segment can be omitted from BOOT kernel. The segment has caused trouble with broken firmware when the firmware tries to load it on top of the actual kernel segment. Discussed with and OK deraadt@
* Fix whitespace.bluhm2021-02-051-3/+3
|
* Prevent that when ugen(4) tries to set an alternative configurationmglocker2021-02-051-1/+5
| | | | | | | | | | descriptor (usually doesn't happen), that we continue to use an outdated cdesc pointer which still refers to the previous cdesc. Instead update the cdesc pointer to the new configuration descriptor. Reported by Thomas Jeunet <cleptho AT gmail DOT com> ok phessler@
* arm_intr_establish_fdt() has long been renamed to fdt_intr_establish().patrick2021-02-053-8/+7
|
* Fix CVS tag.patrick2021-02-051-1/+1
|
* Fix whitespace.patrick2021-02-051-2/+2
|
* Rename probe/attach functions to fit our regular naming scheme. Replacepatrick2021-02-051-13/+13
| | | | | | | | | &armv7_bs_tag with fdt_cons_bs_tag, which is our early console bus tag for both arm64 and armv7. On armv7, it points to &armv7_bs_tag. With this we can get rid of the armv7var.h include. Reduce a bit of diff to imxuart(4). ok kettenis@
* Move exuart(4) to sys/dev/fdt so it can be shared between arm64 and armv7.patrick2021-02-054-12/+12
| | | | ok kettenis@
* exuart(4) does not need to include exclockvar.h. The header seems to onlypatrick2021-02-041-2/+1
| | | | provide a function for the I2C clock frequency, used by exiic(4).
* Tedu exuartvar.h, which has not been needed since we switched to the "newpatrick2021-02-042-20/+1
| | | | way" of attaching the console.
* Add missing CVS tag.patrick2021-02-041-0/+1
|
* Tedu unnecessary imxuartvar.h.patrick2021-02-042-21/+1
| | | | ok kettenis@
* Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton2021-02-0417-16/+1090
| | | | | | | | | exposing battery sensors for HID++ 2.0 devices. Most of the code is derived from the hid-logitech-hidpp Linux driver. Thanks to Ville Valkonen <weezeldinga at gmail dot com> for testing. ok mglocker@
* Add uhidev_set_report_dev() allowing usb drivers to early on install aanton2021-02-042-5/+25
| | | | | | | handler for a specific report id. Needed by an upcoming driver in order to communicate with the device already in the attach routine. ok mglocker@ as part of a larger diff
* Handle Netgear ProSecure UTM25visa2021-02-044-4/+26
| | | | | | | | | | | This makes the system recognize and configure Netgear ProSecure UTM25. Of the network ports, LAN1-4 and WAN1 are functional. WAN2 does not work for some reason. Even though WAN1 has a separate link to the SoC, the connection appears to go through the same switch that the LAN ports use. At the moment, the system relies on U-Boot to set up the switch so that the LAN and WAN segments stay separate. Initial diff and input from Thaison Nguyen, thank you!
* Revert previous commit. The vnode returned by ptm_vn_open() is open andclaudio2021-02-041-33/+28
| | | | | | | can not simply be vrele()-ed on error. The code currently depends on closef() to do the cleanup. Reported-by: syzbot+b0e18235e96adf81883d@syzkaller.appspotmail.com
* Prevent a lock order issue by shuffling code around. Instead of allocatingclaudio2021-02-041-28/+33
| | | | | | the file descriptors early do it late. This way the fdplock is not held during the VFS operations. OK mvs@
* Remove last remnants of ASU ac_flag from accounting.rob2021-02-041-2/+1
| | | | OK deraadt@, bluhm@
* make if_pfsync.c a better friend with PF_LOCKsashan2021-02-044-179/+385
| | | | | | | | | | | | The code delivered in this change is currently disabled. Brave souls may enable the code by adding -DWITH_PF_LOCK when building customized kernel. Big thanks goes to Hrvoje@ for providing test equipment and testing. As soon as we enter the next release cycle, the WITH_PF_LOCK will be defined as default option for MP kernels. OK dlg@
* Add SIOCAIFADDR_IN and SIOCDIFADDR_IN to the wroute pledgetobhe2021-02-031-1/+3
| | | | | | | | to allow setting and removing IPv4 addresses. Needed for future iked(8) improvements. Discussed with sthen@ and florian@ ok bluhm@ deraadt@
* Turns off the direct ACK on every other segmentjan2021-02-031-5/+4
| | | | | | | | | | | | The kernel uses a huge amount of processing time for sending ACKs to the sender on the receiving interface. After receiving a data segment, we send out two ACKs. The first one in tcp_input() direct after receiving. The second ACK is send out, after the userland or the sosplice task read some data out of the socket buffer. Thus, we save some processing time and improve network performance. Longer tested by sthen@ OK claudio@
* After the rev. 1.108 commit we see some issues with ugen(4) behaviour,mglocker2021-02-031-1/+5
| | | | | | | | | | which finally makes umb(4) fail, since ugen(4) attaches to one of the umb(4) interfaces, fails, and marks the whole device dying. Therefore make usbd_device2interface_handle() backwards compatible again. Problem reported by Mikolaj Kucharski. ok edd@
* change pf_route so pf only runs when packets enter and leave the stack.dlg2021-02-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | before this change pf_route operated on the semantic that pf runs when packets go over an interface, so when pf_route changed which interface the packet was on it would run pf_test again. this change changes (restores) the semantic that pf is only supposed to run when packets go in or out of the network stack, even if route-to is responsibly for short circuiting past the network stack. just to be clear, for normal packets (ie, those not touched by route-to/reply-to/dup-to), there isn't a difference between running pf when packets enter or leave the stack, or having pf run when a packet goes over an interface. the main reason for this change is that running the same packet through pf multiple times creates confusion for the state table. by default, pf states are floating, meaning that packets are matched to states regardless of which interface they're going over. if a packet leaving on em0 is rerouted out em1, both traversals will end up using the same state, which at best will make the accounting look weird, or at worst fail some checks in the state and get dropped. another reason for this commit is is to make handling of the changes that route-to makes consistent with other changes that are made to packet. eg, when nat is applied to a packet, we don't run pf_test again with the new addresses. the main caveat with this diff is you can't have one rule that pushes a packet out a different interface, and then have a rule on that second interface that NATs the packet. i'm not convinced this ever worked reliably or was used much anyway, so we don't think it's a big concern. discussed with many, with special thanks to bluhm@, sashan@ and sthen@ for weathering most of that pain. ok claudio@ sashan@ jmatthew@
* As done for the AF_INET multicast case, ensure that passed interfaceclaudio2021-02-021-3/+5
| | | | | via index is actually in the right rdomain for the socket. OK bluhm@ mvs@
* KNF, move { up to if () statementclaudio2021-02-021-3/+2
|
* If IP_MULTICAST_IF or IP_ADD_MEMBERSHIP pass a interface index to theclaudio2021-02-021-3/+6
| | | | | | | kernel make sure that the rdomain of that interface is the same as the rdomain of the inpcb. Problem spotted and fix tested by semarie@ OK bluhm@ mvs@
* Remove obsolete vnode operation vector declarations.visa2021-02-011-6/+1
| | | | OK bluhm@, claudio@, mpi@, semarie@
* handle #pinctrl-cells 2jsg2021-02-011-2/+7
| | | | | needed for >= linux 5.9 dtbs on bbb ok kettenis@
* Fix path MTU discovery for ESP tunneled in IPv6. We always wantbluhm2021-02-012-2/+12
| | | | | | | short TCP segments or fragments encapsulated in ESP instead of fragmented ESP packets. Pass the don't fragment flag down along the stack so that dynamic routes with MTU are created eventually. with and OK markus@; OK tobhe@