aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* virtio: make the write_config buffer argument constAlex Richardson2021-10-116-19/+19
| | | | | | | | No functional change intended, but noticed that we could add const here while adding linuxkpi support for virtio. Reviewed By: bryanv, imp Differential Revision: https://reviews.freebsd.org/D32370
* linuxkpi: implement ida_alloc()Alex Richardson2021-10-111-0/+5
| | | | | | | Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366
* linuxkpi: Allow BUILD_BUG_ON in if statements without bracesAlex Richardson2021-10-111-1/+1
| | | | | | | I got a compilation failure in virtio-gpu without this change. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366
* linuxkpi: add PAGE_ALIGNED macroAlex Richardson2021-10-111-0/+2
| | | | | | | Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366
* linuxkpi: Add sg_init_oneAlex Richardson2021-10-111-0/+7
| | | | | | | Needed for the virtio-gpu driver. Reviewed By: #linuxkpi, manu, bz, hselasky Differential Revision: https://reviews.freebsd.org/D32366
* Allocate arm64 per-CPU data in the correct domainAndrew Turner2021-10-114-18/+39
| | | | | | | | | To minimise NUMA traffic allocate the pcpu, dpcpu, and boot stacks in the correct domain when possible. Submitted by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32338
* Only demote when needed in the arm64 pmap_change_props_lockedAndrew Turner2021-10-111-31/+45
| | | | | | | | | | When changing page table properties there is no need to demote a level 1 or level 2 block if we are changing the entire memory range the block is mapping. In this case just change the block directly. Reported by: alc, kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32339
* Add pmap_change_prot on arm64Andrew Turner2021-10-113-14/+83
| | | | | | | | | | Support changing the protection of preloaded kernel modules by implementing pmap_change_prot on arm64 and calling it from preload_protect. Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32026
* nfsd: Disable the NFSv4.2 Allocate operation by defaultRick Macklem2021-10-111-0/+22
| | | | | | | | | | | | | | | | | | | | Some exported file systems, such as ZFS ones, cannot do VOP_ALLOCATE(). Since an NFSv4.2 server must either support the Allocate operation for all file systems or not support it at all, define a sysctl called vfs.nfsd.enable_v42allocate to enable the Allocate operation. This sysctl is false by default and can only be set true if all exported file systems (or all DSs for a pNFS server) can perform VOP_ALLOCATE(). Unfortunately, there is no way to know if a ZFS file system will be exported once the nfsd is operational, even if there are none exported when the nfsd is started up, so enabling Allocate must be done manually for a server configuration. This problem was detected during a recent NFSv4 interoperability testing event held by the IETF working group. MFC after: 2 weeks
* nfscl: Fix NFS VOP_ALLOCATE for mounts without Allocate supportRick Macklem2021-10-101-7/+2
| | | | | | | | | | | | | Without this patch, nfs_allocate() fell back on using vop_stdallocate() for NFS mounts without Allocate operation support. This was incorrect, since some file systems, such as ZFS, cannot do allocate via vop_stdallocate(), which uses writes to try and allocate blocks. Also, fix nfs_allocate() to return EINVAL when mounts cannot do Allocate, since that is the correct error for posix_fallocate(2). Note that Allocate is only supported by some NFSv4.2 servers. MFC after: 2 weeks
* Enable PPS_SYNC on amd64, arm64 and armv7Konstantin Belousov2021-10-106-6/+22
| | | | | | | | | | | Remove the option from NOTES/LINT, and add to NOTES for powerpc and riscv. PR: 259036 Requested by: John Hay <john@sanren.ac.za> Discussed with: ian, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week
* vfs: add predicts to getvnode and getvnode_pathMateusz Guzik2021-10-101-2/+4
|
* Retire code added to support CloudABIMateusz Guzik2021-10-107-187/+14
| | | | CloudABI was removed in cf0ee8738e31aa9e6fbf4dca4dac56d89226a71a
* vmci: fix panic due to freeing unallocated resourcesMark Peek2021-10-095-4/+61
| | | | | | | | | | | | | | | | | | | | | Summary: An error mapping PCI resources results in a panic due to unallocated resources being freed up. This change puts the appropriate checks in place to prevent the panic. PR: 252445 Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> Tested by: marcus MFC after: 1 week Sponsored by: VMware Test Plan: Along with user testing, also simulated error by inserting a ENXIO return in vmci_map_bars(). Reviewed by: marcus Subscribers: imp Differential Revision: https://reviews.freebsd.org/D32016
* readlinkat(2): allow O_PATH fdKonstantin Belousov2021-10-091-2/+2
| | | | | | | | | PR: 258856 Reported by: ashish Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32390
* timecounter: Let kern.timecounter.stepwarnings be set as a tunableMark Johnston2021-10-091-1/+1
| | | | MFC after: 1 week
* [fib_algo][dxr] Retire counters which are no longer usedMarko Zec2021-10-091-14/+0
| | | | | | The number of chunks can still be tracked via vmstat -z|fgrep dxr. MFC after: 3 days
* [fib_algo][dxr] Improve incremental updating strategyMarko Zec2021-10-091-19/+84
| | | | | | | | | | | | | | Tracking the number of unused holes in the trie and the range table was a bad metric based on which full trie and / or range rebuilds were triggered, which would happen in vain by far too frequently, particularly with live BGP feeds. Instead, track the total unused space inside the trie and range table structures, and trigger rebuilds if the percentage of unused space exceeds a sysctl-tunable threshold. MFC after: 3 days PR: 257965
* arm, arm64, riscv: adjust top-level nexus commentMitchell Horne2021-10-083-9/+3
| | | | | | | | | | These platforms don't manage resources for DMA request lines or I/O ports, this is specific to x86. Remove the references from the comments. Reviewed by: imp, jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32358
* pf: do not copy anchor_wildcard / anchor_relative from userspaceKristof Provost2021-10-082-4/+0
| | | | | | | We overwrite these fields again in pf_kanchor_setup() anyway. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
* net80211: fix build for 526370fb85db4b659cff4625eb2f379acaa4a1a8Bjoern A. Zeeb2021-10-081-1/+1
| | | | | | | | | | | | | In 526370fb85db4b659cff4625eb2f379acaa4a1a8 "net80211: proper ssid length check in setmlme_assoc_adhoc()" we are checking the sizeof on an array function parameter which leads to a warning that it will resturn the size of the type of the array rather than the array size itself. Use the defined length used both in the ioctl and the sizing of the array function parameter instead. Reported by: CI MFC after: 3 days X-MFC with: 526370fb85db4b659cff4625eb2f379acaa4a1a8
* USB: adjust the Generic XHCI ACPI probe return valueBjoern A. Zeeb2021-10-081-1/+1
| | | | | | | | | | Change the probe return value from BUS_PROBE_DEFAULT to BUS_PROBE_GENERIC given this is the "generic" attach method. This allows individual drivers using XHCI generic but needing their own intialisation to gain priority for attaching over the generic implementation. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D32257
* net80211: correct length check in ieee80211_ies_expand()Bjoern A. Zeeb2021-10-081-1/+1
| | | | | | | | | | | | | | | | | In ieee80211_ies_expand() we are looping over Elements (also known as Information Elements or IEs). The comment suggests that we assume well-formedness of the IEs themselves. Checking the buffer length being least 2 (1 byte Element ID and 1 byte Length fields) rather than just 1 before accessing ie[1] is still good practise and can prevent and out-of-bounds read in case the input is not behaving according to the comment. Reported by: (coypu sdf.org) admbugs: 857 MFC after: 3 days Reviewed by: adrian, markj Differential Revision: https://reviews.freebsd.org/D32340
* net80211: proper ssid length check in setmlme_assoc_adhoc()Bjoern A. Zeeb2021-10-081-1/+1
| | | | | | | | | | | | | | | | | A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user supplied buffer. The ssid is a fixed size array for the ioctl and the argument to setmlme_assoc_adhoc(). In addition to an ssid_len check of 0 also error in case the ssid_len is larger than the size of the ssid array to prevent problems. PR: 254737 Reported by: Tommaso (cutesmilee.research protonmail.com) MFC after: 3 days Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D32341
* sctp: improve KASSERT messagesMichael Tuexen2021-10-081-12/+12
| | | | MFC after: 1 week
* vm_fault: do not trigger OOM too earlyKonstantin Belousov2021-10-081-15/+37
| | | | | | | | | | | | | | | | | | | | Wakeup in vm_waitpfault() does not mean that the thread would get the page on the next vm_page_alloc() call, other thread might steal the free page we were waiting for. On the other hand, this wakeup might come much earlier than just vm_pfault_oom_wait seconds, if the rate of the page reclamation is high enough. If wakeups come fast and we loose the allocation race enough times, OOM could be undeservably triggered much earlier than vm_pfault_oom_attempts x vm_pfault_oom_wait seconds. Fix it by not counting the number of sleeps, but measuring the time to th first allocation failure, and triggering OOM when it was older than oom_attempts x oom_wait seconds. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32287
* routing: Use the same index space for both nexthop and nexthop groups.Alexander V. Chernikov2021-10-083-29/+9
| | | | | | | | This simplifies userland object handling along with kernel-level nexthop handling in fib algo framework. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32342
* dwmmc: Calculate the maximum transaction length correctly.Michal Meloun2021-10-081-8/+7
| | | | | | | | | | We should reserve two descriptors (not MMC_SECTORS) for potentially unaligned (so bounced) buffer fragments, one for the starting fragment and one for the ending fragment. Submitted by: kjopek@gmail.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30387
* Make core dump writes interruptible with SIGKILLKonstantin Belousov2021-10-081-0/+7
| | | | | | | | | | This can be disabled by sysctl kern.core_dump_can_intr Reported and tested by: pho Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313
* Add curproc_sigkilled()Konstantin Belousov2021-10-082-0/+24
| | | | | | | | | | Function returns an indicator that the process was killed with SIGKILL Reviewed by: imp, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313
* sys/proc.h: remove dead prototypeKonstantin Belousov2021-10-081-1/+0
| | | | | | | Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313
* kern_sig.c: Remove unused SIGPROP_CANTMASKKonstantin Belousov2021-10-081-1/+0
| | | | | | | Reviewed by: imp, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32313
* riscv: move signal delivery code to exec_machdep.cKonstantin Belousov2021-10-084-383/+515
| | | | | | | | Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310
* arm: move signal delivery code to exec_machdep.cKonstantin Belousov2021-10-083-322/+380
| | | | | | | | Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310
* arm64: move signal delivery code to exec_machdep.cKonstantin Belousov2021-10-084-588/+695
| | | | | | | | | | also move ptrace-related helpers to ptrace_machdep.c. Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310
* i386: move signal delivery code to exec_machdep.cKonstantin Belousov2021-10-084-1391/+1476
| | | | | | | | | | | | also move ptrace-related helpers to ptrace_machdep.c Apply some style. Use ANSI C function definitions. Remove MPSAFE annotations. Reviewed by: emaste, imp Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32310
* riscv: fix VM_MAXUSER_ADDRESS checks in asm routinesMitchell Horne2021-10-072-13/+13
| | | | | | | | | | | | | | | | There are two issues with the checks against VM_MAXUSER_ADDRESS. First, the comparison should consider the values as unsigned, otherwise addresses with the high bit set will fail to branch. Second, the value of VM_MAXUSER_ADDRESS is, by convention, one larger than the maximum mappable user address and invalid itself. Thus, use the bgeu instruction for these comparisons. Add a regression test case for copyin(9). PR: 257193 Reported by: Robert Morris <rtm@lcs.mit.edu> Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31209
* riscv: handle page faults in the unmappable regionMitchell Horne2021-10-073-0/+14
| | | | | | | | | | | | | | | | | | | | | | | When handling a kernel page fault, check explicitly that stval resides in either the user or kernel address spaces, and make the page fault fatal if not. Otherwise, a properly crafted address may appear to pmap_fault() as a valid and present page in the kernel map, causing the page fault to be retried continuously. This is mainly due to the fact that the upper bits of virtual addresses are not validated by most of the pmap code. Faults of this nature should only occur due to some kind of bug in the kernel, but it is best to handle them gracefully when they do. Handle user page faults in the same way, sending a SIGSEGV immediately when a malformed address is encountered. Add an assertion to pmap_l1(), which should help catch other bugs of this kind that make it this far. Reviewed by: jrtc27, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31208
* pf: remove unused field from pf_kanchorKristof Provost2021-10-071-1/+0
| | | | | | | | The 'match' field is only used in the userspace version of the struct (pf_anchor). MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
* ixgbe: Update shared code catchupKevin Bowling2021-10-0714-49/+427
| | | | | | | | | Leftovers from DPDK sync Reviewed by: grehan Obtained from: DPDK MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D31621
* stand: fix build after recent opencrypto changesKyle Evans2021-10-071-0/+2
| | | | | | | Pass the ivlen along through, and just drop this KASSERT() if we're building _STANDALONE for the time being. Fixes: 1833d6042c9a ("crypto: Permit variable-sized IVs ...")
* e1000: print EEPROM/NVM/OROM versionsKevin Bowling2021-10-062-30/+158
| | | | | | | | | This is useful for diagnosing problems. In particular, the errata sheets identify the EEPROM version for many fixes. Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32333
* e1000: Lock nvm print sysctlKevin Bowling2021-10-061-1/+8
| | | | | | | | | Otherwise results in KASSERT with debug kernels because we rely on the iflib CTX lock to implement the software serialization to the NVM model Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32333
* Bump __FreeBSD_version for OCF changes to support variable nonce lengths.John Baldwin2021-10-061-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.John Baldwin2021-10-064-16/+39
| | | | | | | | | | | | | | This is useful for WireGuard which uses a nonce of 8 bytes rather than the 12 bytes used for IPsec and TLS. Note that this also fixes a (should be) harmless bug in ossl(4) where the counter was incorrectly treated as a 64-bit counter instead of a 32-bit counter in terms of wrapping when using a 12 byte nonce. However, this required a single message (TLS record) longer than 64 * (2^32 - 1) bytes (about 256 GB) to trigger. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32122
* cryptosoft: Fix support for variable tag lengths in AES-CCM.John Baldwin2021-10-064-189/+205
| | | | | | | | | | | | | | | | | | | | | | The tag length is included as one of the values in the flags byte of block 0 passed to CBC_MAC, so merely copying the first N bytes is insufficient. To avoid adding more sideband data to the CBC MAC software context, pull the generation of block 0, the AAD length, and AAD padding out of cbc_mac.c and into cryptosoft.c. This matches how GCM/GMAC are handled where the length block is constructed in cryptosoft.c and passed as an input to the Update callback. As a result, the CBC MAC Update() routine is now much simpler and simply performs the XOR-and-encrypt step on each input block. While here, avoid a copy to the staging block in the Update routine when one or more full blocks are passed as input to the Update callback. Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32120
* safexcel: Support truncated tags for AES-CCM.John Baldwin2021-10-061-4/+1
| | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32119
* safexcel: Support multiple nonce lengths for AES-CCM.John Baldwin2021-10-061-7/+14
| | | | | | Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32118
* ccr: Support AES-CCM requests with truncated tags.John Baldwin2021-10-061-4/+24
| | | | | Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32117
* ccr: Support multiple nonce lengths for AES-CCM.John Baldwin2021-10-061-11/+23
| | | | | Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32116