aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* aesni: Support AES-CCM requests with a truncated tag.John Baldwin2021-10-063-19/+17
| | | | | | Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32115
* aesni: Permit AES-CCM requests with neither payload nor AAD.John Baldwin2021-10-061-5/+0
| | | | | | Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32114
* aesni: Handle requests with an empty payload.John Baldwin2021-10-061-10/+18
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32113
* aesni: Support multiple nonce lengths for AES-CCM.John Baldwin2021-10-062-28/+17
| | | | | | Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32112
* crypto: Support multiple nonce lengths for AES-CCM.John Baldwin2021-10-064-19/+90
| | | | | | | | | | | Permit nonces of lengths 7 through 13 in the OCF framework and the cryptosoft driver. A helper function (ccm_max_payload_length) can be used in OCF drivers to reject CCM requests which are too large for the specified nonce length. Reviewed by: sef Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32111
* cryptodev: Allow some CIOCCRYPT operations with an empty payload.John Baldwin2021-10-061-2/+9
| | | | | | | | | | | | | | | | | If an operation would generate a MAC output (e.g. for digest operation or for an AEAD or EtA operation), then an empty payload buffer is valid. Only reject requests with an empty buffer for "plain" cipher sessions. Some of the AES-CCM NIST KAT vectors use an empty payload. While here, don't advance crp_payload_start for requests that use an empty payload with an inline IV. (*) Reported by: syzbot+d4b94fbd9a44b032f428@syzkaller.appspotmail.com (*) Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32109
* cryptodev: Permit CIOCCRYPT for AEAD ciphers.John Baldwin2021-10-061-0/+7
| | | | | | | | | A request without AAD for an AEAD cipher can be submitted via CIOCCRYPT rather than CIOCCRYPTAEAD. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32108
* cryptodev: Permit explicit IV/nonce and MAC/tag lengths.John Baldwin2021-10-062-4/+34
| | | | | | | | | | | | | | Add 'ivlen' and 'maclen' fields to the structure used for CIOGSESSION2 to specify the explicit IV/nonce and MAC/tag lengths for crypto sessions. If these fields are zero, the default lengths are used. This permits selecting an alternate nonce length for AEAD ciphers such as AES-CCM which support multiple nonce leengths. It also supports truncated MACs as input to AEAD or ETA requests. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32107
* cryptosoft, ccr: Use crp_iv directly for AES-CCM and AES-GCM.John Baldwin2021-10-062-25/+10
| | | | | | | | | | Rather than copying crp_iv to a local array on the stack that is then passed to xform reinit routines, pass crp_iv directly and remove the local copy. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32106
* crypto: Permit variable-sized IVs for ciphers with a reinit hook.John Baldwin2021-10-067-26/+45
| | | | | | | | | | Add a 'len' argument to the reinit hook in 'struct enc_xform' to permit support for AEAD ciphers such as AES-CCM and Chacha20-Poly1305 which support different nonce lengths. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32105
* ccp, ccr: Simplify drivers to assume an AES-GCM IV length of 12.John Baldwin2021-10-062-33/+8
| | | | | | | | While here, use crypto_read_iv() in a few more places in ccr(4) that I missed previously. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32104
* cryptodev: Use 'csp' in the handlers for requests.John Baldwin2021-10-061-8/+13
| | | | | | | | | | - Retire cse->mode and use csp->csp_mode instead. - Use csp->csp_cipher_algorithm instead of the ivsize when checking for the fixup for the IV length for AES-XTS. Reviewed by: markj Sponsored by: Chelsio Communications, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32103
* e1000: Function prototype cleanupKevin Bowling2021-10-061-49/+49
| | | | | | | | | | | Drop arguments of function prototypes since the file is mixed between listing arg names and not. No functional changes Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D32329
* malloc: Unmark KASAN redzones if the full allocation size was requestedMark Johnston2021-10-061-0/+7
| | | | | | | | Consumers that want the full allocation size will typically access the full buffer, so mark the entire allocation as valid to avoid useless KASAN reports. Sponsored by: The FreeBSD Foundation
* fusefs: Fix a bug during VOP_STRATEGY when the server changes file sizeAlan Somers2021-10-061-7/+12
| | | | | | | | | | | | | | If the FUSE server tells the kernel that a file's size has changed, then the kernel must invalidate any portion of that file in cache. But the kernel can't do that during VOP_STRATEGY, because the file's buffers are already locked. Instead, proceed with the write. PR: 256937 Reported by: Agata <chogata@moosefs.pro> Tested by: Agata <chogata@moosefs.pro> MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D32332
* fusefs: fix a recurse-on-non-recursive lockmgr panicAlan Somers2021-10-061-4/+16
| | | | | | | | | | | | | | | | | | fuse_vnop_bmap needs to know the file's size in order to calculate the optimum amount of readahead. If the file's size is unknown, it must ask the FUSE server. But if the file's data was previously cached and the server reports that its size has shrunk, fusefs must invalidate the cached data. That's not possible during VOP_BMAP because the buffer object is already locked. Fix the panic by not querying the FUSE server for the file's size during VOP_BMAP if we don't need it. That's also a a slight performance optimization. PR: 256937 Reported by: Agata <chogata@moosefs.pro> Tested by: Agata <chogata@moosefs.pro> MFC after: 2 weeks
* fusefs: quiet some cache-related warningsAlan Somers2021-10-067-107/+76
| | | | | | | | | | | | | | If the FUSE server does something that would make our cache incoherent, we should print a warning to the user. However, we previously warned in some situations when we shouldn't, such as if the file's size changed on the server _after_ our own attribute cache had expired. This change suppresses the warning in cases like that. It also moves the warning logic to a single place within the code. PR: 256936 Reported by: Agata <chogata@moosefs.pro> Tested by: Agata <chogata@moosefs.pro>, jSML4ThWwBID69YC@protonmail.com MFC after: 2 weeks
* linuxkpi: Handle a NULL cache pointer in kmem_cache_destroy()Mark Johnston2021-10-061-0/+3
| | | | | | | | | This is compatible with Linux, and some driver error paths depend on it. Reviewed by: bz, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32337
* When queuing ignored signal, only abort target thread' sleep if it is inside ↵Konstantin Belousov2021-10-062-3/+16
| | | | | | | | | | sigwait() Reported and tested by: trasz Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32252
* When sending ignored signal, arrange for zero return code from sleepKonstantin Belousov2021-10-062-11/+14
| | | | | | | | | | | Otherwise consumers get unexpected EINTR errors without seeing a properly discarded signal. Reported and tested by: trasz Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32252
* Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAITKonstantin Belousov2021-10-062-8/+12
| | | | | | | | | | The flag should be accessible from non-current threads. Reviewed by: markj Tested by: trasz Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32252
* amd64 efirt: do not flush cache for runtime pagesKonstantin Belousov2021-10-061-1/+1
| | | | | | | | | | | | | | | | | | We actually do not know is it safe or not to flush cache for random BAR/register page existing in the system. It is well-known that for instance LAPICs cannot tolerate cache flush. As report indicates, there are more such devices. This issue typically affects AMD machines which do not report self-snoop, causing real CLFLUSH invocation on the mapped pages. Intels do self-snoop, so this change should be nop for them, and unsafe devices, if any, are already ignored. Reported and tested by: manu Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32318
* amd64: add pmap_page_set_memattr_noflush()Konstantin Belousov2021-10-062-0/+18
| | | | | | | | | | | Similar to pmap_page_set_memattr() by setting MD page cache attribute to the argument. Unlike pmap_page_set_memattr(), does not flush cache for the direct mapping of the page. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32318
* apic: initialize lapic_paddr staticallyKonstantin Belousov2021-10-061-1/+1
| | | | | | | | | | | | The default value for LAPIC registers page physical address is usually right. Having this value available early makes pmap_force_invalidate_cache_range(), used on non-self-snoop machines, avoid flushing LAPIC range for early calls. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32318
* cam(4): Limit search for disks in SES enclosure by single busAlexander Motin2021-10-051-0/+8
| | | | | | | | | | | | At least for SAS that we only support now disks are typically connected to the same bus as the enclosure. Limiting the search scope makes it much faster on systems with multiple buses and thousands of disks. Reviewed by: imp MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D32305
* cam(4): Improve XPT_DEV_MATCHAlexander Motin2021-10-054-66/+78
| | | | | | | | | | | | | | | | | Remove *_MATCH_NONE enums, making no sense and so never used. Make *_MATCH_ANY enums 0 (no any match flags set), previously used by *_MATCH_NONE. Bump CAM_VERSION to 0x1a reflecting those changes and add compat shims. When traversing through buses and devices do not descend if we can already see that requested pattern does not match the bus or device. It allows to save significant amount of time on system with thousands of disks when doing limited searches. Reviewed by: imp MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D32304
* sbuf(9): Microoptimize sbuf_put_byte()Alexander Motin2021-10-051-2/+21
| | | | | | | | This function is actively used by sbuf_vprintf(), so this simple inlining in half reduces time of kern.geom.confxml generation. MFC after: 2 weeks Sponsored by: iXsystem, Inc.
* cam: Add doxygen for cam_sim_freeWarner Losh2021-10-051-0/+13
| | | | | | Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D32303
* cesa: remove unused CESA_SESSIONS macroMateusz Guzik2021-10-051-3/+0
| | | | | | | Unused since 1b0909d51a8aa8b5 ("OpenCrypto: Convert sessions to opaque handles instead of integers") Sponsored by: Rubicon Communications, LLC ("Netgate")
* mlx5_en: fix use of CALLOUT_DIRECTKonstantin Belousov2021-10-051-4/+4
| | | | | | | Reported by: markj Reviewed by: hselasky Sponsored by: NVIDIA Networking MFC after: 1 week
* mlx4en(4): Fix wrong mbuf cluster size in mlx4_en_debugnet_init()Hans Petter Selasky2021-10-051-1/+1
| | | | | | | | | | | | | | | | This fixes an "invalid cluster size" panic when debugnet is activated. panic() m_getzone() debugnet_mbuf_reinit() debugnet_any_ifnet_update() ifhwioctl() ifioctl() Submitted by: ae@ PR: 258923 MFC after: 1 week Sponsored by: NVIDIA Networking
* sdhci: Fix crash caused by M_WAITOK in sdhci dumpsBartlomiej Grzesik2021-10-051-2/+10
| | | | | | | | | | | | In some contexts it is illegal to wait for memory allocation, causing kernel panic. By default sbuf_new passes M_WAITOK to malloc, which caused crashes when sdhci_dumpcaps or sdhci_dumpregs was callend in non sutiable context. Add SBUF_NOWAIT flag to sbuf_new to fix this. Obtained from: Semihalf Differential revision: https://reviews.freebsd.org/D32075
* geom_label: Add more validation for NTFS volume tastingMark Johnston2021-10-041-13/+24
| | | | | | | | | | | | | | - Ensure that the computed MFT record size isn't negative or larger than maxphys before trying to read $Volume. - Guard against truncated records in volume metadata. - Ensure that the record length is large enough to contain the volume name. - Verify that the (UTF-16-encoded) volume name's length is a multiple of two. PR: 258833, 258914 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* Add the missing license to gic_if.mAndrew Turner2021-10-041-0/+30
| | | | Sponsored by: The FreeBSD Foundation
* ncurses: document in UPDATING and bump _FreeBSD_versionBaptiste Daroussin2021-10-041-1/+1
|
* pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIBJessica Clarke2021-10-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the same underlying problem as 262459806433, just for bus ranges rather than windows. SiFive's HiFive Unmatched has the following topology: Root Port <---> Bridge <---> Bridge <-+-> Bridge <---> (Unused) (pcib0) (pcib1) (pcib2) | (pcib3) +-> Bridge <---> xHCI | (pcib4) +-> Bridge <---> M.2 E-key | (pcib5) +-> Bridge <---> M.2 M-key | (pcib6) +-> Bridge <---> x16 slot (pcib7) If a device is plugged into the x16 slot that itself has a bridge, such as many graphics cards, we currently fail to allocate a bus number for its child bus (and so pcib_attach_child skips adding a child bus for further enumeration) as, when the new child bridge attaches, it attempts to allocate a bus number from its parent (pcib7) which in turn attempts to grow its own bus range by calling bus_adjust_resource on its own parent (pcib2) whose bus rman cannot accommodate the request and needs to itself be extended by calling its own parent (pcib1). Note that pcib3-7 do not face the same issue when they attach since pcib1 ends up managing bus numbers 1-255 from the beginning and so never needs to grow its own range. Reviewed by: jhb, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32011
* riscv: Add vt and kbdmux to GENERIC for video console supportJessica Clarke2021-10-031-0/+4
| | | | | | | | | | | No in-tree drivers are supported for RISC-V (given it supports UEFI we could enable the EFI framebuffer, but U-Boot has very limited hardware support and EDK2 remains a work in progress), but drm-kmod exists with drivers for video cards that can be used with the HiFive Unmatched. Reviewed by: imp, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32001
* LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guardsJessica Clarke2021-10-032-0/+8
| | | | | | | | | | One of the three uses is already guarded; this guards the remaining ones to support architectures like riscv that do not provide write-combining, and is needed to build drm-kmod on riscv. Reviewed by: hselasky, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31999
* riscv: Add a stub pmap_change_attr implementationJessica Clarke2021-10-032-0/+95
| | | | | | | | | | | | | | pmap_change_attr is required by drm-kmod so we need the function to exist. Since the Svpbmt extension is on the horizon we will likely end up with a real implementation of it, so this stub implementation does all the necessary page table walking to validate the input, ensuring that no new errors are returned once it's implemented fully (other than due to out of memory conditions when demoting L2 entries) and providing a skeleton for that future implementation. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31996
* vfs: remove dead fifoop VOP_KQFILTER implementationsKyle Evans2021-10-032-37/+0
| | | | | | | | | | | These began to become obsolete in d6d64f0f2c26 (r137739) and the deal was later sealed in 003e18aef4c4 (r137801) when vfs.fifofs.fops was dropped and vop-bypass for pipes became mandatory. PR: 225934 Suggested by: markj Reviewe by: kib, markj Differential Revision: https://reviews.freebsd.org/D32270
* sleepqueue(9): Remove sbinuptime() from sleepq_timeout().Alexander Motin2021-10-031-1/+2
| | | | | | | | | | | | | Callout c_time is always bigger or equal than the scheduled time. It is also smaller than sbinuptime() and can't change while the callback is running. So we reliably can use it instead of sbinuptime() here. In case there was a race and the callout was rescheduled to the later time, the callback will be called again. According to profiles it saves ~5% of the timer interrupt time even with fast TSC timecounter. MFC after: 1 month
* ffs: retire unused fsckpid mount optionRobert Wing2021-10-024-118/+6
| | | | | | | | | | | The fsckpid mount option was introduced in 927a12ae16433b50 along with a couple sysctl's to support SU+J with snapshots. However, those sysctl's were never used and eventually removed in f2620e9ceb3ede02. There are no in-tree consumers of this mount option. Reviewed by: mckusick, kib Differential Revision: https://reviews.freebsd.org/D32015
* nfsd: Fix pNFS handling of DeallocateRick Macklem2021-10-021-2/+23
| | | | | | | | | | | For a pNFS server configuration, an NFSv4.2 Deallocate operation is proxied to the DS(s). The code that parsed the reply for the proxy RPC is broken and did not process the pre-operation attributes. This patch fixes this problem. This bug would only affect pNFS servers built from recent main/FreeBSD14 sources.
* arm64: Spell BeagleBone correctly in config file.Tom Hukins2021-10-021-1/+1
| | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/545
* ti(4): Fix a typo in an error messageGordon Bergling2021-10-021-1/+1
| | | | | | - s/chanels/channels/ MFC after: 1 week
* qlnxe: Fix typos in two error messagesGordon Bergling2021-10-021-2/+2
| | | | | | - s/erorr/error/ MFC after: 1 week
* cam: Fix a typo in a commentGordon Bergling2021-10-021-1/+1
| | | | | | - s/perorming/performing/ MFC after: 3 days
* vnic: Fix a typo in a commentGordon Bergling2021-10-021-1/+1
| | | | | | - s/setings/settings/ MFC after: 3 days
* smsc(4): Fix a typo in a commentGordon Bergling2021-10-021-1/+1
| | | | | | - s/setings/settings/ MFC after: 3 days
* evdev: Fix a typo in a commitGordon Bergling2021-10-021-1/+1
| | | | | | - s/prefered/preferred/ MFC after: 3 days