aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* usb: add 32-bit compat for FIFOsBrooks Davis2021-12-173-66/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | Unlike most 32-bit compatability code, this isn't just a simple thunk in the ioctl code. An ioctl (USB_FS_INIT) is used to install a pointer to an array of usb_fs_endpoint structs which are then used by the ugen fifo code. These struct contains an array of pointers which requires translation. We change the interfaces around struct usb_fs_endpoint as follows: - We store the size of struct usb_fs_endpoint in struct usb_fifo in the USB_FS_INIT handler so we know the ABI of the userspace array. - APIs to manipulate userspace struct usb_fs_endpoint objects now take a struct usb_fifo and an index rather than a pointer to the object. This allows most code to remain oblivious to the different struct usb_fs_endpoint sizes. - Add ugen_fs_copyin() which copies the struct usb_fs_endpoint from userspace, thunking it to the native size if required. - Uses of struct usb_fs_endpoint's ppBuffer member are now via ugen_fs_getbuffer() which produces a native pointer. - Updates to userspace are now handled by ugen_fs_update(). For clarity, single, fixed-sized members now are accessed with fueword/suword rather than copyin/copyout. Reviewed by: hselasky, jrtc27 (prior version)
* usb: real freebsd32 support for most ioctlsBrooks Davis2021-12-176-10/+321
| | | | | | | | | | | | Use thunks or alternative access methods to support ioctls without the COMPAT_32BIT hacks that store pointers in uint64_t's on 32-bit platforms. This should allow a normal i386 libusb to work. On CheriBSD, the sizes of the structs will differ between CheriABI (the default) and freebsd64 no matter what so we need proper compat support there. This change paves the way. Reviewed by: hselasky, jrtc27 (prior version)
* pci: add missing PCI id of Coffee Lake GPUCorvin Köhne2021-12-171-0/+1
| | | | | | | | | | | | | The PCI id of an UHD Graphics 630 for Coffee Lake GPUs is missing in the PCI id list of all Intel GPUs. You can take a look at https://dgpu-docs.intel.com/devices/hardware-table.html to check that this device id exists. Or check the linux code: https://github.com/torvalds/linux/commit/d0e062ebb3a44b56a7e672da568334c76f763552 MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33460
* ahci(4): Allow enclosure emulation without hardware.Alexander Motin2021-12-173-16/+33
| | | | | | | | | | After 53f5ac1310e allowed SATA device mapping to enclosure slots, it may have sense to provide enclosure device emulation even without real hardware interface like SGPIO just for purposes of physical device location tracking (still assuming straight cabling). MFC after: 1 week Sponsored by: iXsystems, Inc.
* tcp: allocate statistics in the main tcp_init()Gleb Smirnoff2021-12-172-22/+6
| | | | No reason to have a separate SYSINIT.
* tests: Add some regression tests for a couple of KERN_PROC_* sysctlsMark Johnston2021-12-172-0/+200
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* fd: Avoid truncating output buffers for KERN_PROC_{CWD,FILEDESC}Mark Johnston2021-12-171-25/+29
| | | | | | | | | | | | These sysctls failed to return an error if the caller had provided too short an output buffer. Change them to return ENOMEM instead, to ensure that callers can detect truncation in the face of a concurrently changing fd table. PR: 228432 Discussed with: cem, jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15607
* fd: Initialize more export_fd_buf fields in kern_proc_cwd_out()Mark Johnston2021-12-171-0/+2
| | | | | | | | | | In particular, we need to initialize efbuf->flags, since export_vnode_to_sb() loads that field. This was mostly harmless since the flag only determines whether the output kinfo_file is packed, and KERN_PROC_CWD only ever emits a single kinfo_file anyway. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* qat: Address -Wunused-but-set-variable warningsMark Johnston2021-12-172-23/+4
| | | | MFC after: 1 week
* dtrace: Disable getf() as it is broken on FreeBSDDomagoj Stolfa2021-12-172-1/+5
| | | | | | | | | | | | | | | | | | getf() on FreeBSD calls _sx_slock(), _sx_sunlock() and fget_locked(). Furthermore, it does not set the per-core fault flag, meaning it usually ends up in a double fault panic once getf() does get called, especially from fbt. Reviewing the DTrace Toolkit + a number of other scripts scattered around FreeBSD, I have not been able to find one use of getf(). Given how broken the implementation currently is, we disable it until it can be implemented properly. Also comment out a test in aggs/tst.subr.d for getf(). Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33378
* ktls: Add a regression test to exercise socket error handlingMark Johnston2021-12-171-0/+42
| | | | | | | | | | | Prior to commit 916c61a5ed37 ("Fix handling of errors from pru_send(PRUS_NOTREADY)") this test triggered a kernel panic due to an mbuf double free. Reviewed by: jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33517
* unix: Increase the default datagram recv buffer sizeMark Johnston2021-12-171-1/+1
| | | | | | | | | | | | | | | | | | | syslog(3) was recently change to support larger messages, up to 8KB. Our syslogd handles this fine, as it adjusts /dev/log's recv buffer to a large size. rsyslog, however, uses the system default of 4KB. This leads to problems since our syslog(3) retries indefinitely when a send() returns ENOBUFS, but if the message is large enough this will never succeed. Increase the default recv buffer size for datagram sockets to support 8KB syslog messages without requiring the logging daemon to adjust its buffers. PR: 260126 Reviewed by: asomers MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33380
* bhyve: Only snapshot initialized VirtIO queuesVitaliy Gusev2021-12-171-0/+3
| | | | | | | | | | | If the virtio device is not fully initialized, then suspend fails with: vi_pci_snapshot_queues: invalid address: vq->vq_desc Failed to snapshot virtio-rnd; ret=14 MFC after: 1 week Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D26268
* netinet6: ip6_setpktopt() requires NET_EPOCHKristof Provost2021-12-171-1/+9
| | | | | | | | | | | ip6_setpktopt() can call ifnet_byindex() which requires epoch. Mark the function as requiring NET_EPOCH, and ensure we enter it priot to calling it. Reported-by: syzbot+92526116441688fea8a3@syzkaller.appspotmail.com Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33462
* README.md: update gnu directory descriptionEd Maste2021-12-171-1/+1
| | | | | | | | | (At this point in main we have just LGPL libdialog and dialog, and GPL diff3, left in gnu/.) Reported by: bapt MFC after: 3 days Sponsored by: The FreeBSD Foundation
* test-includes: update badfiles.incKristof Provost2021-12-171-15/+0
| | | | | | | Rebuild badfiles.inc after recent fixes. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33506
* test-includes: use the same header set for badfiles.inc as for testingKristof Provost2021-12-171-2/+2
| | | | | | | | | | | This ensures we don't end up listing files we've excluded (e.g. those starting with _). Add a slight hack to preserve the existing order (sys, then net) in badfiles.inc. Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33505
* sys: make filedesc.h self-containedKristof Provost2021-12-171-0/+1
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: make if_pfsync.h self-containedKristof Provost2021-12-171-0/+6
| | | | | | Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33504
* pf: make if_pflog.h self-containedKristof Provost2021-12-171-0/+3
| | | | | | Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33503
* net: make if_bridgevar.h self-containedKristof Provost2021-12-171-0/+4
| | | | | | Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33502
* net: make ethernet.h self-containedKristof Provost2021-12-171-0/+2
| | | | | | Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33501
* sys: make callout.h self-containedKristof Provost2021-12-173-3/+5
| | | | | | | | | | | Avoid including sys/types.h from sys/_callout.h (as we try to avoid having headers starting with underscores depending on non-underscore headers) by introducing __sbintime_t in sys/_types.h and including that header instead. Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33500
* pf: make pfvar.h self-containedKristof Provost2021-12-171-0/+1
| | | | | | | | | Ensure that the pfvar.h header can be included without including any other headers. Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33499
* if_stf: make if_stf.h self-containedKristof Provost2021-12-171-0/+2
| | | | | | | | | Ensure that the if_stf.h header can be included without including any other headers. Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33498
* follow up to 18679ab1, actually change size of mmc_sim::name to 16Andriy Gapon2021-12-171-1/+1
| | | | | | | The change was made locally but was not squashed into the commit. Fixes: 18679ab1 mmc_sim: fix setting of the mutex name MFC after: 8 days
* snd_uaudio(4): Loosen up the USB MIDI permissions.Hans Petter Selasky2021-12-171-1/+1
| | | | | | | | This makes USB MIDI more userfriendly for desktop users. PR: 260489 MFC after: 1 week Sponsored by: NVIDIA Networking
* pcf85063: Set RTC device to work in 24h modeHubert Mazur2021-12-171-6/+3
| | | | | | | | | | | Sometimes the device did not set default hour mode setting correctly, which lead to conversion errors. Explicitly set device to work in 24h mode by clearing flag in register, instead of allowing defaults. Reviewed by: imp Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D33497
* tzsetup: Fix unicode supportAlfonso Siciliano2021-12-171-0/+5
| | | | Differential revision: https://reviews.freebsd.org/D33532
* sched.h: Use pid_t type for pid argumentDavid CARLIER2021-12-171-1/+1
| | | | | MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33533
* sched_get/setaffinity(3): pid 0 should designate current processMath Ieu2021-12-172-4/+4
| | | | | | | while FreeBSD' native sched_get/setaffinity use pid -1 for this. PR: 260487 MFC after: 1 week
* sysent: regenerate files every timeKyle Evans2021-12-171-0/+5
| | | | | | | | | | | | | | | This forces everything to be regenerated by marking makesyscalls.lua as .PHONY, which may be helpful in, e.g., rebase scenarios, which may have unexpected effects on mtimes but still really need a regen. For now we apply this to the default sysent target, which is ran manually and not as a part of buildkernel. We can reconsider this if someone manually running it has issues with the runtime, but the top level sysent target can run each in parallel; I recommend -j4 or so. Requested by: kib Reviewed by: brooks, kib (both earlier version) Differential Revision: https://reviews.freebsd.org/D33357
* sysent: regenerateKyle Evans2021-12-174-224/+0
|
* sysent: move away from allowing all compat options for other ABIsKyle Evans2021-12-175-16/+37
| | | | | | | | | | | | | | | Notably, the current compat_options only makes sense for native and freebsd32 ABIs. For the others, it just adds cruft. Switch to having sets of compat options, and default to the native set. Setup the other ABIs where it doesn't make sense to opt-out of the native set. This removes some redundant COMPAT_FREEBSD* stuff from Linuxolator bits. line_expr in makesyscalls.lua is fixed to allow empty strings to be specified, since they're harmless. Reviewed by: brooks, kib (both earlier version) Differential Revision: https://reviews.freebsd.org/D33356
* inpcb: don't leak the port zone in in_pcbinfo_destroy()Gleb Smirnoff2021-12-161-0/+1
|
* nfscl: Partially revert commit 867c27c23a5cRick Macklem2021-12-161-4/+4
| | | | | | | | | | | | | | Commit 867c27c23a5c enabled the n_directio_opens code in open/close, which sets/clears NNONCACHE, for IO_APPEND. This code should not be enabled unless newnfs_directio_enable is non-zero. This patch reverts that part of commit 867c27c23a5c. A future patch that fixes the case where the file that is being written IO_APPEND is mmap()'d. MFC after: 3 months
* cryptocheck: Test Camellia-CBC cipher and RIPEMD-160 HMAC.John Baldwin2021-12-161-0/+13
| | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33518
* cryptosoft: Remove CBC handling from swcr_encdec.John Baldwin2021-12-161-57/+8
| | | | | | | | All of the CBC ciphers now handle block chaining in the enc_xform. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33489
* crypto: Move CBC handling into enc_xform_camellia.John Baldwin2021-12-161-7/+37
| | | | | | | | | | Add an IV to the context that is initialized by the reinit hook. Encrypt and decrypt operations handle cipher block chaining along with updating the IV saved in the context. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33488
* crypto: Move CBC handling into enc_xform_aes_cbc.John Baldwin2021-12-161-7/+37
| | | | | | | | | | Add an IV to the context that is initialized by the reinit hook. Encrypt and decrypt operations handle cipher block chaining along with updating the IV saved in the context. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33487
* crypto: Consistently use AES instead of Rijndael128 for the AES-CBC cipher.John Baldwin2021-12-166-22/+22
| | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33486
* crypto: Define POLY1305_BLOCK_LEN constant.John Baldwin2021-12-162-1/+3
| | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33485
* Sort libsodium sources by path in sys/modules/crypto/Makefile.John Baldwin2021-12-161-4/+4
| | | | | | | | | This matches the order used in sys/conf/files to make it easier to keep these two files in sync. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33484
* Sort libsodium entries by path in sys/conf/files.John Baldwin2021-12-161-12/+12
| | | | | | Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33483
* Correct type size format error in KASSERT.Doug Moore2021-12-161-2/+2
| | | | | Reported by: jenkins Fixes: 6f1c8908272f vm: Don't break vm reserv that can't meet align reqs
* Remove 'All Rights Reserved' from xlocale FreeBSD Foundation copyrightsEd Maste2021-12-1611-11/+0
| | | | Sponsored by: The FreeBSD Foundation
* vm: Don't break vm reserv that can't meet align reqsDoug Moore2021-12-161-29/+65
| | | | | | | | | | | | | | Function vm_reserv_test_contig has incorrectly used its alignment and boundary parameters to find a well-positioned range of empty pages in a reservation. Consequently, a reservation could be broken mistakenly when it was unable to provide a satisfactory set of pages. Rename the function, correct the errors, and add assertions to detect the error in case it appears again. Reviewed by: alc, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33344
* loader.efi: Do not use as frame buffer BLT-only GOPs.Alexander Motin2021-12-161-4/+16
| | | | | | | | | | | | Kernel needs physical frame buffer address and size, which Block Transfer-only Graphics Output Protocol instances do not have. Some recent ASUS boards like PRIME Z690M-PLUS D4 and PRIME H570-Plus report two GOPs, out of which the second one support ConOut protocol, that made it preferable, but is BLT-only, that made console unusable. Discussed with: tsoome (previous version) MFC after: 1 week
* ipfilter: MSN RPC proxy is not completeCy Schubert2021-12-161-328/+0
| | | | | | | The MSN RPC proxy is incomplete and does not do any address translation. Remove it. MFC after: 1 week
* OpenSSL: Do not remove symbolic links readded in 1.1.1mJung-uk Kim2021-12-161-4/+0
| | | | Reported by: Herbert J. Skuhra <herbert@mailbox.org>