aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add sys/_align.h replacing machine/_align.hHEADmainBrooks Davis2 hours16-260/+40
| | | | | | | | | | | | | | | | Define _ALIGNBYTES using sizeof(void *) (no functional change on any existing architecture) which will allow it to work with CHERI were we must align things up to capability alignment. In _ALIGN, replace integer manipulation which does not preserve pointer provenance with a type and provenance preserving builtin. This requires modest changes in code which assumes _ALIGN returns an integer, but those are relatively rare. Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53947
* libcasper: fix warnings when _ALIGN preserves typesBrooks Davis2 hours1-2/+2
| | | | | | | | | | | Without the void * casts, the compiler complains about an alignment requirement increase. Reviewed by: kib, markj Obtained from: CheriBSD Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D53946
* get*ent: be consistant about _ALIGN(p) - pBrooks Davis2 hours7-13/+21
| | | | | | | | | | | | | Add an nscache specific inline function to calculate the misalignment rather than adding and subtracting _ALIGN(p) and p which can take the buffer far out of bound (undefined behavior in C and unsupported on CHERI). Reviewed by: kib Effort: CHERI upstreaming Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D53945
* Update share/mk files from bmakeSimon J. Gerraty8 hours18-199/+232
| | | | | | | | | | | | | | | | | Update to the latest makefiles etc from bmake. Mostly this just replaces sjg license with an SPDX tag. There are also some improvements to meta2deps* and optimizations to leverage POSIX shell features in some target scripts. Default isPOSIX_SHELL to ':' in sys.mk to enable these. Use :sh1 in M_type if possible. bsd.progs.mk has diverged too much to touch beyond making the SPDX tag update. Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D54150
* rc.d/ipfilter: ipfilter must be enabled for options to takeCy Schubert13 hours1-6/+3
| | | | | | | | | | | | ipfilter options are erased and reset to default when ipfilter is disabled. This results in nullifying options from rc.conf that were previously set. 8d6feaaaa26f, which added this code, was incorrect as it was for a bug in ipfilter 4.2.28 and no longer applies to ipfilter 5.1.2. Fixes: 8d6feaaaa26f MFC after: 1 day
* splice: Fix leaks that can happen when initiating a spliceAndrew Gallatin15 hours1-17/+27
| | | | | | | | | | | | | | | | - change the state to SPLICE_EXCEPTION to allow so_unsplice() to work to cleanup failed splices (fixes socket reference leak) - NULL out sp->dst when unsplicing from so_splice() before so2 has been been referenced. - Deal with a null sp->dst / so2 in so_unsplice - Fix asserts that talked about sp->state == SPLICE_INIT; that state is not possible here. Differential Revision: https://reviews.freebsd.org/D54157 Reviewed by: markj Sponsored by: Netflix Fixes: c0c5d01e5374 ("so_splice: Synchronize so_unsplice() with so_splice()") MFC after: 3 days
* rc.d/{ipfilter,ippool}: Fix typo in variable nameCy Schubert17 hours2-2/+2
| | | | MFC after: 1 day
* bhnd_bus_*_resource: Remove redundant type and rid argumentsJohn Baldwin17 hours22-111/+58
| | | | | | | | | | | | | | Remove type and rid arguments from bhnd_bus_(activate|deactivate|release)_resource. This should have been done earlier to match the changes made to bus_release_resource, etc. While fixing up the callers, remove rid members from softc structures since the only time a value is needed is as a constant input to bhnd_bus_alloc_resource*. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53410
* bhnd_bus_alloc_resource*: Pass rid by valueJohn Baldwin17 hours12-17/+17
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53409
* dpaa2_rc_add_res: Pass rid by valueJohn Baldwin17 hours1-16/+14
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53408
* gpio_alloc_intr_resource: Pass rid by valueJohn Baldwin17 hours8-9/+9
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53407
* acpi_PkgGas: Pass rid by valueJohn Baldwin17 hours4-7/+7
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53406
* acpi_bus_alloc_gas: Pass rid by valueJohn Baldwin17 hours7-13/+13
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53405
* pci_reserve_map: Pass rid by valueJohn Baldwin17 hours3-17/+17
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53404
* resource_list_reserve: Pass rid by valueJohn Baldwin17 hours5-18/+17
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53403
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin17 hours83-282/+276
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* Revert "netlink: Fix overallocation of netlink message buffers"John Baldwin17 hours1-16/+11
| | | | | | | | | This patch was based on an incorrect assumption that the linear buffer chain for an snl_writer only contained the netlink message body. This reverts commit 828df4d36d9d5a6ca0dcc294d65572b4a0474142. Sponsored by: AFRL, DARPA
* linuxkpi: Take const root in read-only radix tree functionsJean-Sébastien Pédron19 hours2-6/+6
| | | | | | | | This is a preparation step for a future addition to this file. This is also closer to what Linux does. Reviewed by: emaste Sponsored by: The FreeBSD Foundation
* linux: fix build without VIMAGEGleb Smirnoff20 hours1-0/+1
| | | | Fixes: fbf05d2147b1add8b760be166c4b1fd4499ebce8
* zfs: Reuse ZINCDIR variable from kmod.mkJohn Baldwin21 hours1-6/+5
| | | | | Reviewed by: brooks, imp Differential Revision: https://reviews.freebsd.org/D54147
* rman: Embed the mutex in struct rman instead of using a separate allocationJohn Baldwin21 hours2-37/+34
| | | | | | | | | This used a separate allocation when rman was first imported (back when the lock was a pre-SMPng "simplelock" instead of a mutex). Reported by: des Reviewed by: des Differential Revision: https://reviews.freebsd.org/D54143
* rman: Simplify initialization of internal globalsJohn Baldwin21 hours1-9/+3
| | | | | | | | Use TAILQ_HEAD_INITIALIZER and MTX_SYSINIT to remove the 'once' code from rman_init. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D54142
* nvmf_che: Add a manual page for the Chelsio NVMe/TCP PDU offload driverJohn Baldwin21 hours2-0/+81
| | | | | Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D53764
* nvmf_tcp.4: Don't quote the document description given to .NdJohn Baldwin21 hours1-1/+1
| | | | Reported by: ziaee
* cxgbe: Stop using bus_space_tag/handle directlyJohn Baldwin22 hours3-19/+11
| | | | | | Reviewed by: np, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D53030
* trim.8: fix misprintEugene Grosbein22 hours1-1/+1
| | | | | | | Grammar fix after previous commit. MFC after: 1 week X-MFC-with: dbc4a1c69191909a7210cad6da46b755557d0d34
* trim.8: minor update for manual pageEugene Grosbein23 hours1-3/+13
| | | | | | | Further explain that trim(8) is not for trimming free blocks in populated file systems/ZFS pools, as people still take it wrong sometimes. MFc after: 1 week
* if_ovpn: use epoch to free peersKristof Provost23 hours1-2/+12
| | | | | | | | | | | | Avoid a possible use-after-free in the rx path. ovpn_decrypt_rx_cb() calls ovpn_finish_rx() which releases the lock, but continues to use the peer. Ensure that the peer cannot be freed until we're sure all potential users have stopped using it (i.e. have left net_epoch). Reported by: Kevin Day <kevin@your.org> MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
* sys/_types.h: recognise char8_t as a builtin type in C++20Robert Clausecker24 hours1-0/+4
| | | | | | | | | | | | | Unlike in C23 where it's a typedef, char8_t is a built in type in C++20. Recognise it as such. PR: 291449 Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Approved by: markj (mentor) Reviewed by: imp Fixes: f0e541118c374869a8226eaa1320bb6eda248a20 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54124
* stress2: Added a regression testPeter Holm27 hours1-0/+191
|
* shutdown(8): Document additional formats supported by the code.Xin LI32 hours1-15/+47
| | | | MFC after: 1 week
* ofed/libibverbs: remove no longer needed local alloca.hKonstantin Belousov37 hours4-21/+0
| | | | | Sponsored by: NVidia networking MFC after: 1 week
* ofed/libibverbs: remove strdupa() hack from config.hKonstantin Belousov37 hours1-3/+3
| | | | | | | | It is now provided by regular string.h. While there, remove stale $FreeBSD$ svn tag, and add include guards. Sponsored by: NVidia networking MFC after: 1 week
* libc/string: add strdupa(3) and strndupa(3)Konstantin Belousov39 hours3-2/+64
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54066
* libc/string: put source files list one item per lineKonstantin Belousov39 hours1-23/+121
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54066
* vm_fault: only rely on PG_ZERO when the page was newly allocatedKonstantin Belousov39 hours1-1/+5
| | | | | | | | | | | | | If the fs->m page was found invalid on the object queue, PG_ZERO flag is stale. Track the source of the page in the new fault state variable m_needs_zero, and ignore PG_ZERO if the page did not came from the allocator. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53963
* vm_page.h: remove no longer defined (P) locking annotationKonstantin Belousov39 hours1-2/+2
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53963
* bsdinstall: Mount /dev and /packages after using the shell to partition disksJohn Baldwin40 hours5-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally after partitions are created by the installer, the 'mount' script is used to mount the target disk partitions under /mnt. The tail end of this script also mounts a couple of additional filesystems under /mnt so that chrooted programs can work such as devfs and /packages. When the "Shell" option is used to permit the user to manually mount the destination filesystem, the "mount" script is not used as the user is instructed to mount the target filesystems and construct /mnt/etc/fstab, etc. However, this means that the user is responsible for mounting devfs (which is not included in /etc/fstab) and /packages as well. The help message for the "Shell" option doesn't mention these requirements, so users may not know to do so. This can lead to confusing errors as chrooted commands can fail to find needed /dev entries. For example, running fwget to fetch wireless firmware fails because /dev/pci doesn't exist. To make this less painful for users using this option, split out the bottom half of the 'mount' script that mounts these non-fstab-related filesystems into a separate 'mount_aux' script. Invoke 'mount_aux' after using "Shell" to create the filesystem to ensure that these filesystems are always present. PR: 290901 Reported by: Peter <freebsd@peterk.org> Tested by: Peter <freebsd@peterk.org> Differential Revision: https://reviews.freebsd.org/D53770
* locale: make install Unicode 17.0.0/CLDR 48Jose Luis Duran43 hours51-137461/+152537
| | | | | | | | | | | | Unicode 17.0 adds 4803 characters, for a total of 159,801 characters. The new additions include 4 new scripts: - Sidetic - Tolong Siki - Beria Erfe - Tai Yo https://www.unicode.org/versions/Unicode17.0.0/
* man typos: Fix pf.conf.5 and jail.2 typosSeth Hoffert44 hours2-2/+2
| | | | | | MFC after: 3 days Signed-off-by: Seth Hoffert <seth.hoffert@gmail.com> Closes: https://github.com/freebsd/freebsd-src/pull/1919
* sound examples: Check if setting property was successfulGoran Mekić44 hours2-4/+22
| | | | | | MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D54038
* lltable: use own lockGleb Smirnoff44 hours8-64/+65
| | | | | | | | | Add struct mtx to struct lltable and stop using IF_AFDATA_LOCK, that was created for a completely different purpose. No functional change intended. Reviewed by: zlei, melifaro Differential Revision: https://reviews.freebsd.org/D54086
* linux: store Linux Ethernet interface number in struct ifnetGleb Smirnoff44 hours11-78/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | The old approach where we go through the list of interfaces and count them has bugs. One obvious bug with this dynamic translation is that once an Ethernet interface in the middle of the list goes away, all interfaces following it would change their Linux names. A bigger problem is the ifnet arrival and departure times. For example linsysfs has event handler for ifnet_arrival_event, and of course it wants to resolve the name. This accidentially works, due to a bug in if_attach() where we call if_link_ifnet() before invoking all the event handlers. Once the bug is fixed linsysfs won't be able to resolve the old way. The other side is ifnet_departure_event, where there is no bug, the eventhandlers are called after the if_unlink_ifnet(). This means old translation won't work for departure event handlers. One example is netlink. This change gives the Netlink a chance to emit a proper Linux interface departure message. However, there is another problem in Netlink, that the ifnet pointer is lost in the Netlink translation layer. Plug this with a cookie in netlink writer structure that can be set by the route layer and used by the Netlink Linux translation layer. This part of the diff seems unrelated, but it is hard to make it a separate change, as the old KPI goes away and to use the new one we need the pointer. Differential Revision: https://reviews.freebsd.org/D54077
* linux: separate all ifnet(9) related code into linux_ifnet.cGleb Smirnoff44 hours4-289/+312
| | | | | | | | Remove linux_use_real_ifname(). It is no longer used outside of the file since 3ab3c9c29cf0. There is no functional change. Reviewed by: melifaro, dchagin Differential Revision: https://reviews.freebsd.org/D54076
* proc0_post: Clear relevant thread stats directlyJohn Baldwin45 hours1-3/+6
| | | | | | | | | rufetch() has several other effects besides clearing these per-thread stats most of which are explicitly discarded by the subsequent calls to ruxreset(). Just clear the relevant stats directly instead. Reviewed by: olce, kib, markj Differential Revision: https://reviews.freebsd.org/D54050
* thread0: Clear td_rux stats in proc0_postJohn Baldwin45 hours1-2/+6
| | | | | | | | | | | proc0_post aims to reset the CPU usage accounting for all threads and processes in the system to zero once the time of day is verified. However, not all of the per-thread stats were not being cleared, resulting in over-reported time for thread0 post-boot. Reviewed by: olce, kib, markj Fixes: bed4c5241663 ("Implement RUSAGE_THREAD. Add td_rux...") Differential Revision: https://reviews.freebsd.org/D54040
* ruxreset: Add an inline function to reset all the stats in rusage_extJohn Baldwin45 hours2-4/+13
| | | | | | | | Use it in proc0_post to reset per-process CPU usage. Suggested by: olce Reviewed by: olce, kib Differential Revision: https://reviews.freebsd.org/D54049
* ipfilter: Disable ipfs(8) by defaultCy Schubert45 hours8-2/+28
| | | | | | | | | | | | | At the moment ipfs(8) is a tool that can be easily abused. Though the concept is sound the implementation needs some work. ipfs(8) should be considered experimental at the moment. This commit also makes ipfs support in the kernel optional. Reviewed by: emaste, glebius MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53787
* ipfilter: Restrict ipfilter within a jailCy Schubert45 hours5-0/+19
| | | | | | | | | | | | | | | | | | | | Add a sysctl/tunable (net.inet.ipf.jail_allowed) to control whether a jail can manage its own ipfilter rules, pools, and settings. A jail's control over its own ipfilter rules and settings may not be desireable. The default is jail access to ipfilter is denied. The host system can stil manage a jail's rules by attaching the rules, using the on keyword, limiting the rule to the jail's interface. Or the sysctl/tunable can be enabled to allow a jail control over its own ipfilter rules and settings. Implementation note: Rather than store the jail_allowed variable, referenced by sysctl(9), in a global area, storing the variable in the ipfilter softc is consistent with ipfilter's use of its softc. Discussed with: emaste, jrm MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53623
* pf: Fix error handling in pf_handle_get_tstats()Mark Johnston47 hours1-0/+10
| | | | | | | | | | | - pfr_table_count() can return an error. - We must check for failure from mallocarray(M_NOWAIT). Fixes: 9e8d2962aad3 ("pf: convert DIOCRGETTSTATS to netlink") Reported by: Kevin Day <kevin@your.org> Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54094