summaryrefslogtreecommitdiffstats
path: root/sys (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Fold fitting sysctl_rdint into sysctl_bounded_arr in i386 cpu_sysctlgnezdo2021-01-091-11/+6
| | | | OK millert@
* Enforce range with sysctl_int_bounded in etherip_sysctlgnezdo2021-01-091-2/+3
| | | | OK millert@
* Enforce range with sysctl_int_bounded in swap_encrypt_ctlgnezdo2021-01-091-2/+3
| | | | OK millert@
* Enforce range with sysctl_int_bounded in pipex_sysctlgnezdo2021-01-091-3/+3
| | | | OK millert@
* Enforce range with sysctl_int_bounded in ipip_sysctlgnezdo2021-01-091-2/+3
| | | | OK millert@
* Enforce range with sysctl_int_bounded in sysctl_wdoggnezdo2021-01-091-3/+5
| | | | OK millert@
* Enforce range with sysctl_int_bounded in witness_sysctl_watchgnezdo2021-01-091-10/+8
| | | | | | Makes previously explicit checking less verbose. OK millert@
* Enforce range with sysctl_int_bounded in tcp_sysctlgnezdo2021-01-091-18/+15
| | | | | | | One case uses the explicit range from the code and the other was inferred from reading the usage. OK millert@
* Finish converting ddb_sysctl to sysctl_int_boundedgnezdo2021-01-091-27/+7
| | | | | | | I missed the verbose pattern that it used for error checking the first time around. OK millert@
* Use sysctl_int_bounded in sysctl_hwsmtgnezdo2021-01-091-6/+2
| | | | | | Prefer error reporting is to silent clipping. OK millert@
* Revert mistaken commit: Stop wsmux_attach_sc race from anton@gnezdo2021-01-091-2/+2
|
* Stop wsmux_attach_sc race from anton@gnezdo2021-01-091-2/+2
| | | | OK millert@
* Include the optimized putchar functions only if RASOPS_SMALL is notfcambus2021-01-091-4/+4
| | | | | | defined, as was previously the case. OK kettenis@
* "encoding of diag instructions is hard, let's go shopping"kettenis2021-01-092-69/+31
| | | | | | | Clean up things a bit, adding documentation about the source of the information about these instructions. From miod@
* If the loop check in somove(9) goes to release without setting anbluhm2021-01-091-3/+2
| | | | | | | error, a broadcast mbuf will stay in the socket buffer forever. This is bad as multiple mbufs can use up all the space. Better report ELOOP, dissolve splicing, and let userland handle it. OK anton@
* Syzkaller has found a stack overflow in socket splicing. Broadcastbluhm2021-01-091-2/+5
| | | | | | | | | | | | packets were resent through simplex broadcast delivery and socket splicing. Although there is an M_LOOP check in somove(9), it did not take effect. if_input_local() cleared the M_BCAST and M_MCAST flags with m_resethdr(). As if_input_local() is used for broadcast and multicast delivery, it was a mistake to delete them. Keep the M_BCAST and M_MCAST mbuf flags when packets are reinjected into the network stack. Reported-by: syzbot+a43ace363f1b663238f8@syzkaller.appspotmail.com OK anton@; discussed with claudio@
* Enable support for floating-point exceptions. We always run in "precise"kettenis2021-01-098-31/+68
| | | | | | | | | | | | mode. On modern processors (POWER8 and later) there is no performance penalty for this as long as exceptions are disabled in the FPSCR (which is the default). This way we don't have to implement an architecture-dependent system call to set the mode, as it can only be done by the kernel. With help from gkoehler@ ok gkoehler@
* Replace a custom linked list with SLIST.visa2021-01-091-12/+10
|
* Replace SIMPLEQ with SLIST because the code does not need a queue.visa2021-01-091-26/+24
|
* Remove unnecessary relocking of w_mtx as panic() should not return.visa2021-01-091-10/+2
|
* Now we do not call ttyopen() in sioopen(), we do not need the variableaoyama2021-01-091-2/+1
| | | | 'error' anymore.
* don't check local carp addresses as part of the antispoof checks.dlg2021-01-081-2/+3
| | | | | | | | | | | | | | | | | | bridge(4) drops packets coming from somewhere else that have a source MAC address that's owned by one of the interfaces that's a member of the bridge. because this check was done with bridge_ourether, it included the addresses of active carp interfaces hanging off these member interfaces. this meant if the local machine is the carp master while another machine is trying to preempt it by sending hellos, the packets from the other machine were dropped because the local one is already the master. carp roles are supposed to move around a l2 network, so another host sending a packet with a carp mac address is actually normal and necessary. found by and fix tested by stsp@ ok stsp@ claudio@
* Bring the emulated Linux memory allocation interfaces more in line withkettenis2021-01-083-39/+126
| | | | | | | | | what Linux does. Let vmalloc() use km_alloc(9) instead of malloc(9) and let kvmalloc() only use malloc(9) for small (less than a page) allocations and atomic allocations. This should reduce the pressure on the "interrupt-safe" map. ok jsg@
* Lock kernel before raising SPL in klist_lock()visa2021-01-081-3/+3
| | | | | | | | | This prevents unwanted spinning with interrupts disabled. At the moment, this code is only invoked through klist_invalidate() and the callers should already hold the kernel lock. Also, one could argue that in MP-unsafe contexts klist_lock() should only assert for the kernel lock.
* Fix boot-time crash on sparc64visa2021-01-081-4/+15
| | | | | | | | | | | | On sparc64, initmsgbuf() is invoked before curcpu() is usable on the boot processor. Consequently, it is unsafe to use mutexes during the message buffer initialization. Avoid such use by skipping log_mtx when appending a newline from initmsgbuf(). Use mbp instead of msgbufp as the buffer argument to the putchar routine for consistency. Bug reported and fix suggested by miod@
* Revert "Implement select(2) and pselect(2) on top of kqueue."visa2021-01-081-148/+58
| | | | | | | | | | The use of kqueue as backend has introduced a significant regression in the performance of select(2), so go back to using the original code. Some additional management overhead is to be expected when using kqueue. However, the overhead of the current implementation is too high. Reported by bluhm@ on bugs@
* Fix typo in comment.kettenis2021-01-071-2/+2
|
* Extend IP_ADD_MEMBERSHIP to also support struct ip_mreqn.claudio2021-01-072-64/+87
| | | | | | | struct ip_mreqn allows to use the interface index to select the interface for multicast packets which makes it possible to use this with unnumbered interfaces. OK dlg@ robert@
* Adjust comment about klist_invalidate()visa2021-01-071-5/+8
|
* Let a process open a video(4) device multiple timesjca2021-01-061-7/+12
| | | | | | | | | | The previous behavior was conservative but a bit too restrictive. The V4L API lets several processes open a single video device, with exclusive access to certain methods when a process starts streaming. This is not trivial to implement. This small change fixes webcam usage with Firefox and BigBlueButton. Diff simplified + ok mglocker@, thanks!
* Mark a layer 2 address as expired by setting the length to 0 when theflorian2021-01-061-1/+3
| | | | | | | | | associated IPv6 NDP entry is invalidated. Otherwise we end up with an INCOMPLETE entry that can't be updated to STALE and REACHABLE by neighbor advertisements and thus interrupting communication. This is the same as arpinvalidate() for IPv4. Guidance bluhm & claudio, fix proposed by claudio OK claudio
* Add dt(4) TRACEPOINTs for pool_get() and pool_put(), this is simmilar to theclaudio2021-01-062-2/+11
| | | | | | ones added to malloc() and free(). Pass the struct pool pointer as argv1 since it is currently not possible to pass the pool name to btrace. OK mpi@
* Allocate pages for the F00F bug fix using km_alloc(9) instead ofjmatthew2021-01-061-2/+2
| | | | | | | uvm_km_zalloc(9). tested on qemu pretending to be a 586 ok bluhm@
* pppoeintr() is no morekn2021-01-051-2/+1
|
* the tx doorbell is next to the rx doorbell, not on top of it.dlg2021-01-041-2/+2
|
* Process pppoe(4) packets directly, do not queue through netiskn2021-01-045-41/+11
| | | | | | | | | | Less scheduling, lock contention and queues. Previously, if_netisr() handled the net lock around those calls, now if_input_process() does it before calling ether_input(), so no need to add or remove NET_*LOCK() anywhere. OK mvs claudio
* - fix use after free, when packet gets dropped.sashan2021-01-041-5/+3
| | | | | | patch submitted by Ralf Horstmann from ackstorm.de OK dlg@
* Remove kernel lock from pppoe(4) input pathkn2021-01-041-3/+1
| | | | | | | | | | | | "struct pppoe_softc" documents no member being protected by the kernel lock (alone); further review of the code paths starting from pppoeintr() shows no sleeping points which must be avoided in the softnet thread. Everything is fine as is to run without the big lock, so remove it. Tests sthen Feedback mpi mvs OK mvs claudio
* Minor refactoring in pf(4). Note that struct pfsync_state is nobluhm2021-01-042-35/+19
| | | | | | longer memcopied but assigned. Alignment should not be an issue as it is __packed. Part of a larger diff from dlg@; OK dlg@ sashan@
* Remove unused `pipex_iface_context' struct.mvs2021-01-042-18/+2
| | | | ok ok@ yasuoka@
* use bus_dmamap_sync around updates to the doorbells.dlg2021-01-041-33/+69
| | | | ok jmatthew@
* Allocate address space for reposting vga devices using km_alloc(9) ratherjmatthew2021-01-032-14/+18
| | | | | | than uvm_km_valloc(9). ok kettenis@
* Use native display resolution 1368x768 with Lynloong all-in-one computers.visa2021-01-021-3/+7
| | | | From Yifei ZHAN on tech@
* Make kernel recognize Lynloong LM9002/9003 and LM9013.visa2021-01-021-1/+5
| | | | | | | | | | | LM9002/9003 is very similar to LM9001 since it works just fine on LM9002 with the codebase for LM9001. LM9013 on the other hand is fairly different from LM9001 and is more like Yeeloong 8089 when it comes to hardware design. More work might be needed to make it fully functional. From Yifei ZHAN on tech@
* Don't call if_deactivate() in switch_clone_destroy(). Followingmvs2021-01-021-2/+1
| | | | | | if_detach() will do this. ok kn@
* Don't call if_deactivate() in bridge_clone_destroy(). Followingmvs2021-01-021-4/+1
| | | | | | if_detach() will do this. ok kn@
* Remove PIPEX{S,G}MODE ioctl(2) commands. This time they are pretty dummymvs2021-01-022-11/+2
| | | | | | and were kept only for backward compatibility reasons. ok mpi@ yasuoka@
* optimise bpf_catchpacket and bpf_wakeup.dlg2021-01-021-17/+10
| | | | | | | | | | | | | | | bpf_catchpacket had a chunk to deal with reader timeouts, but that has largely been moved to bpfread. the vestigal code that was left still tried to wake up a reader when a buffer got full, but there already is a chunk of code that wakes up readers when the buffer gets full. bpf_wakeup now checks for readers before calling wakeup directly, rather than pushing the wakeup to a task and calling it unconditionally. the task_add is now only done when the bpfdesc actually has something that needs it. ok visa@
* Allocate address space for struct cpu_info using km_alloc(9) instead ofjmatthew2021-01-021-2/+8
| | | | | | uvm_km_valloc(9). Tested on a T5120. ok mpi@
* pool(9): remove tickscheloha2021-01-022-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | Change the pool(9) timeouts to use the system uptime instead of ticks. - Change the timeouts from variables to macros so we can use SEC_TO_NSEC(). This means these timeouts are no longer patchable via ddb(4). dlg@ does not think this will be a problem, as the timeout intervals have not changed in years. - Use low-res time to keep things fast. Add a local copy of getnsecuptime() to subr_pool.c to keep the diff small. We will need to move getnsecuptime() into kern_tc.c and document it later if we ever have other users elsewhere in the kernel. - Rename ph_tick -> ph_timestamp and pr_cache_tick -> pr_cache_timestamp. Prompted by tedu@ some time ago, but the effort stalled (may have been my fault). Input from kettenis@ and dlg@. Special thanks to mpi@ for help with struct shuffling. This change does not increase the size of struct pool_page_header or struct pool. ok dlg@ mpi@