summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2021-02-11Don't hardcode com(4)'s major number in exuart(4).Patrick Wildt
ok kettenis@
2021-02-11sbdrop(): use NULL instead of 0 in pointer assignmentmvs
ok bluhm@
2021-02-11We link `ifp' to `if_list' before we perform if_attachsetup(). It is notmvs
fully initialized because we initialize `if_groups' after linking. It's not triggered because if_attach() and if_unit(9) are serialized by kernel lock and `ifp' is often filled by nulls. Move `if_groups' initialization to if_attach_common() to prevent this. ok bluhm@ claudio@ deraadt@
2021-02-11Add missing break in switch statement of rge_activate().Stefan Sperling
CID 1501716 ok kevlo@ and mestre@ had the same diff
2021-02-11Leave out gp initialization from kernel entry on mips64Visa Hankala
On OpenBSD/mips64, the kernel is compiled with -mno-abicalls. This disables gp-relative addressing and essentially makes gp a spare register in the kernel. Hence it is unnecessary to initialize gp when entering the kernel. The _gp symbol is not needed either. Suggested by miod@
2021-02-11"proc: table is full" actually means thread table is full; ok mpi@ sthen@Otto Moerbeek
2021-02-11In the various open functions reduce the fdplock() to only span over theClaudio Jeker
function which need the lock (falloc, fdinsert, fdremove). In most cases it is not correct to hold the lock while calling VFS functions or e.g. closef since those aquire or release long lived VFS locks. OK visa@ mvs@
2021-02-11Initialize var since it's used in a condition a little bit afterwards.Ricardo Mestre
CID 1501713 ok jmatthew@
2021-02-11Initialize the stack local device id variable correctly.anton
CID 1501705
2021-02-11Swap faddr/laddr and fport/lport arguments in call to stoeplitz_ipXport().Patrick Wildt
Technically the whole point of the stoeplitz API is that it's symmetric, meaning that the order of addresses and ports doesn't matter and will produce the same hash value. Coverity CID 1501717 ok dlg@
2021-02-11Make room for handling of HID++ 1.0 devices. No functional change.anton
2021-02-11Use idx suffix consistently.anton
2021-02-11Remove unused software id macro.anton
2021-02-11Fold long line.anton
2021-02-11Stop uhidpp from claiming all report ids, instead only claim theanton
necessary ones. Solves a regression introduced with the arrival of uhidpp causing some Logitech HID devices from attaching to its appropriate driver. Thanks to <naszy at poczta dot fm> and Peter Kane <pwkane at gmail dot com> for reporting and trying out diffs. ok mglocker@
2021-02-11Add uhidev_unset_report_dev(), doing the opposite ofanton
uhidev_set_report_dev(). Needed by some upcoming changes to uhidpp. ok mglocker@
2021-02-11If uhidev_set_report_dev() already have been invoked for the givenanton
report id, there's no point in trying to find a matching sub device. ok mglocker@
2021-02-10Add a instruction barrier between writing CCSELR_EL1 and reading CCSIDR_EL1Mark Kettenis
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@
2021-02-10If pf changes the routing table when sending packets, the kernelAlexander Bluhm
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@
2021-02-10Interface group names must fit into IFNAMSIZ and be unique. ButAlexander Bluhm
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@
2021-02-10Remove `sc_dead' logic from pppac(4). It is used to preventmvs
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@
2021-02-10Move UNIX domain sockets out of kernel lock. The new `unp_lock' rwlock(9)mvs
used as solock()'s backend to protect the whole layer. With feedback from mpi@. ok bluhm@ claudio@
2021-02-09Make sure that switching the console from serial to framebuffer worksMark Kettenis
for framebuffer nodes under / and /chosen. ok patrick@
2021-02-09pfsync_state_import() must not be called with the pf state lock held,Patrick Wildt
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@
2021-02-09ddb: when a new wsdisplay console attaches, resize ddb cols/rows to itJoshua Stein
ok visa
2021-02-09Activate use of PF_LOCK() by removing the WITH_PF_LOCK ifdefs.Patrick Wildt
Silence from the network group ok sashan@
2021-02-09Add a barrier between reading the cqe flags and the command ID, whichJonathan Matthew
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@
2021-02-08change discipline name from "RAID1C" to "RAID 1C" to match the man pagesStefan Sperling
2021-02-08Remove maxburst feature from tcp_outputjan
OK bluhm@, claudio@, deraadt@
2021-02-08Start refcounting interface groups with 1. if_creategroup() returnsAlexander Bluhm
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@
2021-02-08Add a RAID1C (raid1 + crypto) softraid(8) discipline.Stefan Sperling
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@
2021-02-08Add a RAID1C (raid1 + crypto) softraid(8) discipline.Stefan Sperling
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@
2021-02-08Revert the convertion of per-process thread into a SMR_TAILQ.Martin Pieuchot
We did not reach a consensus about using SMR to unlock single_thread_set() so there's no point in keeping this change.
2021-02-08Do not hold onto the fdplock longer then needed. Release the lock afterClaudio Jeker
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@
2021-02-08Simplify sleep_setup API to two operations in preparation for splittingMartin Pieuchot
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@
2021-02-066.9-betaTheo de Raadt
2021-02-06Simplex interface sends packet back without hardware checksumAlexander Bluhm
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@
2021-02-06Revise kernel's ld.script on octeonVisa Hankala
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@
2021-02-05Fix whitespace.Alexander Bluhm
2021-02-05Prevent that when ugen(4) tries to set an alternative configurationMarcus Glocker
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@
2021-02-05arm_intr_establish_fdt() has long been renamed to fdt_intr_establish().Patrick Wildt
2021-02-05Fix CVS tag.Patrick Wildt
2021-02-05Fix whitespace.Patrick Wildt
2021-02-05Rename probe/attach functions to fit our regular naming scheme. ReplacePatrick Wildt
&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@
2021-02-05Move exuart(4) to sys/dev/fdt so it can be shared between arm64 and armv7.Patrick Wildt
ok kettenis@
2021-02-04exuart(4) does not need to include exclockvar.h. The header seems to onlyPatrick Wildt
provide a function for the I2C clock frequency, used by exiic(4).
2021-02-04Tedu exuartvar.h, which has not been needed since we switched to the "newPatrick Wildt
way" of attaching the console.
2021-02-04Add missing CVS tag.Patrick Wildt
2021-02-04Tedu unnecessary imxuartvar.h.Patrick Wildt
ok kettenis@
2021-02-04Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton
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@