aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* loader: Move drawer.lua over to gfx table.Warner Losh2024-02-161-6/+19
| | | | | | | | | | | | | Drawer.lua is the only bit of lua code in the base that uses any of the functons moved from the loader table to the gfx table. Move the main code to using the gfx dispatch. Add compat code for running on old loaders that creates the newer-style gfx table with the term_* functions we call in it populated. This will even work on the super old versions of the loader that don't have them (we'll still skip using them). Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D43908
* loader: Move gfx functions to gfx.lua.8Warner Losh2024-02-163-72/+124
| | | | | | | | | | Now that the fb_* and term_* functions are available in the gfx table, move the documentation to gfx.lua.8. Add information about backwards compatibility. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D43907
* loader: Move to using linker sets to bring in optional bitsWarner Losh2024-02-163-26/+39
| | | | | | | | | The graphics stuff is optional. When it is pulled into the system, we use a linker set to initialize the lua bindings for it now. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43906
* loader: Remove gfx_fb_stub.c, it's no longer neededWarner Losh2024-02-165-85/+2
| | | | | | | | | | Now that we draw in the gfx bindings for all our interpreters only when graphics support is compiled in, we can eliminate this from all the loaders that don't have graphics support. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43905
* loader: Only create gfx 4th bindings when gfx is availableWarner Losh2024-02-164-190/+263
| | | | | | | | | | | | Only create the gfx bindings for 4th when it's compiled into the loader. We do this with a linker set that only gets brought in to those loaders that call gfx_framework_init. This calls gfx_interp_md() will will drag in gfx_loader.c which will add to the linker set that registers these bindings. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43904
* loader: Add prototype for gfx_interp_mdWarner Losh2024-02-163-0/+15
| | | | | | | | | | This function will be used to draw in the graphics bindings when the loader is compiled with graphics (gfx) support. Provide definitions for lua and the simple interpreter. 4th support is forthcoming. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43903
* loader: Create new gfx tableWarner Losh2024-02-162-1/+27
| | | | | | | | | | Create a new gfx global table. Put into it all the graphics bindings that we have in loader today. For now, have compatability binding for loader. Remove them from loader. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43902
* loader: Separate gfx to a new file.Warner Losh2024-02-164-203/+245
| | | | | | | | Move gfx lua hook registration to a new file. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43901
* loader: Register the gfx stuff separately.Warner Losh2024-02-161-0/+11
| | | | | | | | | Move registration of the gfx stuff to separate function. However, no change in functionality is intended. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43900
* loader: Simplify the loader.has_commandWarner Losh2024-02-161-5/+6
| | | | | | | | | | luaL_checkstring already checks for the right number of arguments. There's no need to do that by hand here. Now an exception will be thrown like any other function with the wrong args. Also, push a boolean instead of an int. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43820
* reboot: Use posix_spawn instead of systemWarner Losh2024-02-161-16/+38
| | | | | | | | | Use posix_spawn to avoid having to allocate memory needed for the system command line. Sponsored by: Netflix Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D43860
* ipfw: Skip to the start of the loop when following a keep-state ruleKarim Fodil-Lemelin2024-02-161-2/+1
| | | | | | | | | | | | | | | | | | When a packet matches an existing dynamic rule for a keep-state rule, the matching engine advances the "instruction pointer" to the action portion of the rule skipping over the match conditions. However, the code was merely breaking out of the switch statement rather than doing a continue, so the remainder of the loop body after the switch was still executed. If the first action opcode contains an F_NOT but not an F_OR (such as an "untag" action), then match is toggled to 0, and the code exits the inner loop via a break which aborts processing of the actions. To fix, just use a continue instead of a break. PR: 276732 Reviewed by: jhb, ae MFC after: 2 weeks
* pci_host_generic: Properly handle bus_release_resource of IRQ resourcesJohn Baldwin2024-02-161-4/+12
| | | | | | | | | | | | | Unlike other bus methods updated to use bus_generic_rman_* in commit d79b6b8ec267, the bus_release_resource method was using bus_generic_rman_release_resource for all types other than PCI_RES_BUS. Instead, bus_generic_rman_* should only be used for memory and I/O port resources for this driver. Tested by: cperciva Reviewed by: cperciva Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation Differential Revision: https://reviews.freebsd.org/D43925
* pci_host_generic: Set a valid error if allocating a range resource failsJohn Baldwin2024-02-161-0/+1
| | | | | | | | Previously pci_host_generic_attach was returning 0 (success) incorrectly if allocating a range failed. The error value was 0 from the previously successful call to bus_set_resource in this case. Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
* simplebus: Implement bus_delete_resourceJohn Baldwin2024-02-161-0/+1
|
* simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resourceJohn Baldwin2024-02-161-3/+3
| | | | | | | | Specifically, the set/get_resource methods do not currently remap resource types, so remap the type in alloc_resource only after looking for a matching resource list entry. Fixes: 3cf553288b96 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY
* reboot: initialize howtoWarner Losh2024-02-151-1/+2
| | | | | | | Make static analyzers happy by initialzing howto to 0. Coverity is cranky that it could be used unused. But it's analysis is incomplete because the args to getopt when it wasn't initialized preclude it from being used.
* heimdal: Fix NULL derefCy Schubert2024-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | A flawed logical condition allows a malicious actor to remotely trigger a NULL pointer dereference using a crafted negTokenInit token. Upstream notes: Reported to Heimdal by Michał Kępień <michal@isc.org>. From the report: Acknowledgement --------------- This flaw was found while working on addressing ZDI-CAN-12302: ISC BIND TKEY Query Heap-based Buffer Overflow Remote Code Execution Vulnerability, which was reported to ISC by Trend Micro's Zero Day Security: CVE-2022-3116 Obtained from: upstream 7a19658c1 MFC after: 1 week
* heimdal: always confirm PA-PKINIT-KX for anon PKINITCy Schubert2024-02-152-0/+93
| | | | | | | | | | | | | | | Import upstream 38c797e1a. Upstream notes: RFC8062 Section 7 requires verification of the PA-PKINIT-KX key excahnge when anonymous PKINIT is used. Failure to do so can permit an active attacker to become a man-in-the-middle. Reported by: emaste Obtained from: upstream 38c797e1a Security: CVE-2019-12098 MFC after: 1 week
* heimdal: CVE-2022-41916: Check for overflow in _gsskrb5_get_mech()Cy Schubert2024-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | Apply upstream 22749e918 to fix a buffer overflow. Upstream notes: If len_len is equal to total_len - 1 (i.e. the input consists only of a 0x60 byte and a length), the expression 'total_len - 1 - len_len - 1', used as the 'len' parameter to der_get_length(), will overflow to SIZE_MAX. Then der_get_length() will proceed to read, unconstrained, whatever data follows in memory. Add a check to ensure that doesn't happen This is similar to samba CVE-2022-3437. Reported by: emaste Security: CVE-2022-41916 Obtained from: upstream 22749e918 MFC after: 1 week
* Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksumCy Schubert2024-02-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream's explanation of the problem: S4U2Self is an extension to Kerberos used in Active Directory to allow a service to request a kerberos ticket to itself from the Kerberos Key Distribution Center (KDC) for a non-Kerberos authenticated user (principal in Kerboros parlance). This is useful to allow internal code paths to be standardized around Kerberos. S4U2Proxy (constrained-delegation) is an extension of this mechanism allowing this impersonation to a second service over the network. It allows a privileged server that obtained a S4U2Self ticket to itself to then assert the identity of that principal to a second service and present itself as that principal to get services from the second service. There is a flaw in Samba's AD DC in the Heimdal KDC. When the Heimdal KDC checks the checksum that is placed on the S4U2Self packet by the server to protect the requested principal against modification, it does not confirm that the checksum algorithm that protects the user name (principal) in the request is keyed. This allows a man-in-the-middle attacker who can intercept the request to the KDC to modify the packet by replacing the user name (principal) in the request with any desired user name (principal) that exists in the KDC and replace the checksum protecting that name with a CRC32 checksum (which requires no prior knowledge to compute). This would allow a S4U2Self ticket requested on behalf of user name (principal) user@EXAMPLE.COM to any service to be changed to a S4U2Self ticket with a user name (principal) of Administrator@EXAMPLE.COM. This ticket would then contain the PAC of the modified user name (principal). Reported by: emaste Security: CVE-2018-16860 Obtained from: Upstream c6257cc2c MFC after: 1 week
* Heimdal: Fix transit path validation CVE-2017-6594Cy Schubert2024-02-151-2/+10
| | | | | | | | | | | | | | | | Apply upstream b1e699103. This fixes a bug introduced by upstream f469fc6 which may in some cases enable bypass of capath policy. Upstream writes in their commit log: Note, this may break sites that rely on the bug. With the bug some incomplete [capaths] worked, that should not have. These may now break authentication in some cross-realm configurations. Reported by: emaste Security: CVE-2017-6594 Obtained from: upstream b1e699103 MFC after: 1 week
* pci_pci: Remove obsolete commentJohn Baldwin2024-02-151-5/+0
| | | | | This comment referred to the layering violation fixed in commit b377ff8110e3489eb6e6b920b51a2384dfc4eb0b.
* vmd: Use bus_generic_rman_* for PCI bus and memory resourcesJohn Baldwin2024-02-151-25/+108
| | | | | | | | | While here, add custom bus_map/unmap_resource methods to request mappings via the window memory resources allocated from the parent bus. Tested by: emaste Differential Revision: https://reviews.freebsd.org/D43886
* vmd: Use bus_read/write_* instead of bus_space_read/write_*John Baldwin2024-02-152-17/+6
| | | | | | | Using an explicit bus space tag and handle is deprecated. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43885
* riscv: Add missing includes for DDBJohn Baldwin2024-02-151-1/+6
| | | | | | | | | | The #ifdef DDB code in parse_metadata was dead code without opt_ddb.h. While here, update the call to db_fetch_ksymtab for changes in commit 02bc014a200a. Reviewed by: mhorne Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D43919
* psci: Add FDT node status checkStephen J. Kiernan2024-02-151-0/+3
| | | | | | | | Consider the PSCI missing if the FDT node status says it is not okay. Reviewed by: andrew Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43920
* socket tests: add listener_wakeupGleb Smirnoff2024-02-152-0/+295
| | | | | | | | | | | | | | | | | | This test runs several scenarios when sleep(9) on a listen(2)ing socket is interrupted by shutdown(2) or by close(2). What should happen in that case is not specified, neither is documented. However, there is certain behavior that we have and this test makes sure it is preserved. There is software that relies on it, see bug 227259. This test is based on submission with this bug, bugzilla attachment 192260. The test checks TCP and unix(4) stream socket behavior and SCTP can be added easily if needed. The test passes on FreeBSD 11 to 15. It won't pass on FreeBSD 10, although the wakeup behavior of shutdown(2) is the same, but it doesn't return error. PR: 227259
* sockets: repair wakeup of accept(2) by shutdown(2)Gleb Smirnoff2024-02-153-21/+18
| | | | | | | | | | That was lost in transition from one-for-all soshutdown() to protocol specific methods. Only protocols that listen(2) were affected. This is not a documented or specified feature, but some software relies on it. At least the FreeSWITCH telephony software uses this behavior on PF_INET/SOCK_STREAM. Fixes: 5bba2728079ed4da33f727dbc2b6ae1de02ba897
* rights.4: Remove sentence implying that rights are a maskEd Maste2024-02-151-1/+0
| | | | | | | | | | | | Capability rights passed to cap_rights_* are (now) not simple bitmaks and cannot be ORed together in general (although it will work for certain subsets of rights). Remove sentence that implied rights are masks. We already have the sentence "The complete list of capability rights is provided below" so listing the rights without an introductory sentence seems fine. PR: 277057
* path_test: fix cap_rights_init usageEd Maste2024-02-151-3/+3
| | | | | | | | | | Capability rights passed to cap_rights_* are not simple bitmaks and cannot be ORed together in general (although it will work for certain subsets of rights). PR: 277057 Fixes: e5e1d9c7b781 ("path_test: Add a test case for...") Sponsored by: The FreeBSD Foundation
* bsdinstall: remove two dead mirrorsPhilip Paeps2024-02-151-2/+0
|
* bsdinstall: prefer HTTPPhilip Paeps2024-02-151-1/+2
| | | | | | | | In 2024, users are more likely to have working HTTP than working FTP. Present http://ftp.FreeBSD.org as the first option in the installer. Keep ftp://ftp.FreeBSD.org as the second option. MFC after: 3 weeks
* pfsync: Fix offset calculationKajetan Staszkiewicz2024-02-151-12/+16
| | | | | | | | | | Even though message version is automatically recognized and the top of the struct is identical for different versions, when iterating over multiple messages proper message length must be used. That's the length of an union member for given version, not of the union itself. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D43862
* zfs: merge openzfs/zfs@e0bd8118dMartin Matuska2024-02-1540-157/+746
|\ | | | | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #15469 cbe882298 Add slow disk diagnosis to ZED #15857 d0d273320 Update zfs-snapshot.8 #15864 a5a725440 zfs list: add '-t fs' and '-t vol' options #15874 6cc93ccde BRT: Fix slop space calculation with block cloning #15882 a0635ae73 zdb: Fix false leak report for BRT objects Obtained from: OpenZFS OpenZFS commit: e0bd8118d04b55b7adf3d9ba256ad4bb53e66512
| * Linux: Cleanup taskq threads spawn/exitAlexander Motin2024-02-133-71/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes taskq_thread_should_stop() to limit maximum exit rate for idle threads to one per 5 seconds. I believe the previous one was broken, not allowing any thread exits for tasks arriving more than one at a time and so completing while others are running. Also while there: - Remove taskq_thread_spawn() calls on task allocation errors. - Remove extra taskq_thread_should_stop() call. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #15873
| * zdb: Fix false leak report for BRT objectsBi112024-02-131-0/+11
| | | | | | | | | | | | | | | | | | Fix a misreport in 'zdb -d' where it falsely marked BRT objects as leaked. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Yuxin Wang <yuxinwang9999@gmail.com> Closes #15882
| * BRT: Fix slop space calculation with block cloningBi112024-02-121-1/+2
| | | | | | | | | | | | | | | | | | Similar to deduplication, the size of data duplicated by block cloning should not be included in the slop space calculation. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Yuxin Wang <yuxinwang9999@gmail.com> Closes #15874
| * Allowing PERFPOOL to be defined by zfs-test usersKevin Greene2024-02-091-1/+1
| | | | | | | | | | | | Reviewed-by: John Wren Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Kevin Greene <kevin.greene@delphix.com> Closes #15868
| * Update zfs-snapshot.8Shawn Bayern2024-02-081-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a small inaccuracy in the description of snapshot atomicity zfs-snapshot(8) appears to contain a small error. The existing version reads "Snapshots are taken atomically, so that all snapshots correspond to the same moment in time." Per zfs_main.c, which in do_snapshot() simply loops over argv, this does not appear to be correct when multiple snapshots are specified explicitly on the command line. I believe the intent of the man page was to say that *recursive* snapshots are all created atomically. This proposed change fixes that error. Because the existing statement may confuse some readers anyway, the commit also also adds a small amount of general explanatory information that may be helpful. The change also adds an introductory sentence that summarizes what 'zfs snapshot' does in the first place. In that sentence, the text "different datasets" is intended to indicate that (again per the code) the same dataset cannot be specified multiple times on the command line. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Shawn Bayern <sbayern@law.fsu.edu> Closes #15857
| * zfs list: add '-t fs' and '-t vol' optionsRob N2024-02-082-7/+26
| | | | | | | | | | | | | | | | Because "filesystem" and "volume" are just too long! Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #15864
| * Add slow disk diagnosis to ZEDDon Brady2024-02-0829-70/+654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slow disk response times can be indicative of a failing drive. ZFS currently tracks slow I/Os (slower than zio_slow_io_ms) and generates events (ereport.fs.zfs.delay). However, no action is taken by ZED, like is done for checksum or I/O errors. This change adds slow disk diagnosis to ZED which is opt-in using new VDEV properties: VDEV_PROP_SLOW_IO_N VDEV_PROP_SLOW_IO_T If multiple VDEVs in a pool are undergoing slow I/Os, then it skips the zpool_vdev_degrade(). Sponsored-By: OpenDrives Inc. Sponsored-By: Klara Inc. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Allan Jude <allan@klarasystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Rob Wing <rob.wing@klarasystems.com> Signed-off-by: Don Brady <don.brady@klarasystems.com> Closes #15469
* | libcasper: fix cap_rights_init usageEd Maste2024-02-151-8/+8
| | | | | | | | | | | | | | | | | | | | Capability rights passed to cap_rights_* are not simple bitmaks and cannot be ORed together in general (although it will work for certain subsets of rights). PR: 277057 Fixes: faaf43b2a750 ("fileargs: add tests") Sponsored by: The FreeBSD Foundation
* | net: bandaid for plugging a fw_com leak in fwip_detach()Tai-hwa Liang2024-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a temporary workaround for plugging a fw_com upon if_fwip unloading. Steps to reproduce(needs two hosts connected with firewire): while true; do ifconfig fwip0 10.0.0.5 up fwcontrol -r ping -c 10.0.0.3 kldunload if_fwip done There's a chance that the unloading of if_fwip.ko triggers following warning: Warning: memory type fw_com leaked memory on destroy (1 allocations, 64 bytes leaked). commit d79b6b8ec267e7eef6e07cf4245159705e24acd5 (origin/main, origin/HEAD)
* | cat: fix cap_rights_init usageEd Maste2024-02-151-1/+1
| | | | | | | | | | | | | | | | | | Capability rights passed to cap_rights_* are not simple bitmaks and cannot be ORed together in general (although it will work for certain subsets of rights). PR: 277057 Reported by: asomers, markj
* | pci_host_generic: Don't rewrite resource start address for translationJohn Baldwin2024-02-142-132/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate resources from the parent device for decoded physical address ranges. When child resources suballocated from rman's are mapped, translate those mapping requests into a mapping request of the associated physical address range in a bus_map_resource method. While here, convert generic_pcie_rman to a bus_get_rman method and use bus_generic_rman_* for operations on child resources. Factor out a generic_pcie_containing_range to share logic between bus_translate_resource and bus_*map_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43894
* | physmem ram: Don't reserve excluded regionsJohn Baldwin2024-02-141-25/+0
| | | | | | | | | | | | | | | | | | | | | | These regions can conflict with I/O resources and prevent allocation of those regions by other drivers. It may make sense to reserve them after the boot-time probe of devices has concluded (or after an initial pass to reserve firmware-assigned resources before "wildcard" resources are allocated), but that would require additional changes. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43893
* | acpi: Allow child drivers to use bus_set_resource for more resourcesJohn Baldwin2024-02-142-36/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | acpi_set_resource excludes certain types of resources for certain devices. The intention of this is to avoid adding resource entries for bogus resources enumerated via _CRS. However, this also prevents drivers from adding those resources explicitly if needed. To fix this, move the logic to exclude these resources into an ignore hook used when parsing _CRS to create the initial set of resources for each device. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43892
* | acpi: Don't assume a resource is reserved in acpi_delete_resourceJohn Baldwin2024-02-141-1/+2
| | | | | | | | | | | | | | | | | | This fixes a panic if a driver uses bus_set_resource to add a resource that fails to reserve and then deletes the resource via bus_delete_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43891
* | pci_host_generic: Include the bridge's device name in rman descriptionsJohn Baldwin2024-02-141-3/+16
| | | | | | | | | | | | | | | | | | The rman description strings now match those used in the PCI-PCI bridge driver. Using more specific names removes ambiguity in devinfo -u output on systems with multiple host to PCI bridges. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43890