aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ufs: Avoid subobject overflow in snapshot expunge codeJessica Clarke2022-01-021-2/+4
| | | | | | | | | | | | | | | | | The code here tries to be smart and zeroes out both di_db and di_ib with a single bzero call, thereby overrunning the di_db subobject. This is fine on most architectures, if a little dodgy. However, on CHERI, the compiler can optionally restrict the bounds on pointers to subobjects to just that subobject, in order to mitigate intra-object buffer overflows, and this is enabled in CheriBSD's pure-capability kernels. Instead, use separate bzero calls for each array, and let the compiler optimise it as it sees fit; even if it's not generating inline zeroing code, Clang will happily optimise two consecutive bzero's to a single larger call. Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D33651
* ufs: Rework shortlink handling to avoid subobject overflowsJessica Clarke2022-01-0210-31/+35
| | | | | | | | | | | | | | | | | | | | Shortlinks occupy the space of both di_db and di_ib when used. However, everywhere that wants to read or write a shortlink takes a pointer do di_db and promptly runs off the end of it into di_ib. This is fine on most architectures, if a little dodgy. However, on CHERI, the compiler can optionally restrict the bounds on pointers to subobjects to just that subobject, in order to mitigate intra-object buffer overflows, and this is enabled in CheriBSD's pure-capability kernels. Instead, clean this up by inserting a union such that a new di_shortlink can be added with the right size and element type, avoiding the need to cast and allowing the use of the DIP macro to access the field. This also mirrors how the ext2fs code implements extents support, with the exact same structure other than having a uint32_t i_data[] instead of a char di_shortlink[]. Reviewed by: mckusick, jhb Differential Revision: https://reviews.freebsd.org/D33650
* mountmsdosfs(): some styleKonstantin Belousov2022-01-021-30/+25
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33721
* amd64 sigtramp: comment-out annotations for registers with DWARF number >= 32Konstantin Belousov2022-01-021-2/+5
| | | | Sponsored by: The FreeBSD Foundation
* busdma: _bus_dmamap_addseg repairedDoug Moore2022-01-025-10/+10
| | | | | | | | | | | A recent change introduced a one-off error into a test allowing coalescing chunks into segments. This fixes that error. broke a check in _bus_dmamap_addseg on many architectures. This change makes it clear that it is not a particular range that is being boundary-checked, but the proposed union of the two adjacent ranges. Reported by: se Reviewed by: se Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere Differential Revision: https://reviews.freebsd.org/D33715
* tcp_bbr(4): Fix a few typos in sysctl descriptionsGordon Bergling2022-01-021-4/+4
| | | | | | - s/measurment/measurement/ MFC after: 3 days
* sesutil: Widen "Desc" field to fit "Drive Slot 23"Poul-Henning Kamp2022-01-021-3/+3
|
* pmcstudy: fix error handlingsebastien.bini2022-01-021-1/+7
| | | | | | | Close file descriptor in the correct way if no counters are built into the application. Obtained from: Stormshield
* smp.h: make sign conversion explicitsebastien.bini2022-01-021-1/+1
| | | | | | | | When comparing singed with unsigned the signed value is casted to unsigned. Make this explicit as it might lead to compilation warnings otherwise. Obtained from: Stormshield
* iicbb: Always build ofw_bus_if.hWarner Losh2022-01-021-6/+1
| | | | | | | | | | Always make ofw_bus_if.h. While it's only used when option FDT is in the kernel, it can always be generated. In theory we could omit it if option FDT isn't present, but none of the rest of sys/modules does that. That fine-grained control likely won't be reliable w/o a redesign of the kernel/module config system. Sponsored by: Netflix
* Add clarifying commentsWarner Losh2022-01-023-3/+11
| | | | | | | | Expand on the terse comments for where each of these files is used. Reviewed by: emaste Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33716
* systat -vm: Humanize output for ease of reading.Kirk McKusick2022-01-021-37/+37
| | | | | | | | | | | Using 8 width is too wide for large numbers like 1379991K; 1330M is easier to read. Submitted by: ota_j.email.ne.jp Reviewed by: mckusick MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33495
* Fix grammatical issues.Nathan Whitehorn2022-01-021-1/+1
|
* iwlwifi: clarify page updateBjoern A. Zeeb2022-01-012-10/+23
| | | | | | | | | | | | | Based on some feedback clarify the man page for - how to load the driver currently - status of the driver with respect to iwm(4) and leave a comment to (automatically) add a full list of chipsets to the man page. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: debdrup Differential Revision: https://reviews.freebsd.org/D33713
* bsddialog: convert bsdinstall/distextractAlfonso Siciliano2022-01-012-91/+92
| | | | Differential Revision: https://reviews.freebsd.org/D33581
* sctp: improve counting of incoming chunksMichael Tuexen2022-01-011-0/+2
| | | | MFC after: 3 days
* udp6: remove assignments not being usedMichael Tuexen2022-01-011-5/+0
| | | | | MFC after: 3 days Sponsored by: Netflix, Inc.
* udp: use appropriate pcbinfo when signalling EHOSTDOWNMichael Tuexen2022-01-011-1/+1
| | | | | MFC after: 3 days Sponsored by: Netflix, Inc.
* in_pcb: improve inp_next()Michael Tuexen2022-01-011-0/+2
| | | | | | | | If there is no inp to check, exit the loop iterating through them. Reported by: syzbot+403406a9cbf082b36ea4@syzkaller.appspotmail.com Reviewed by: glebius Sponsored by: Netflix, Inc.
* route: use NULL for null ptr in getaddr call, not 0Ed Maste2022-01-011-7/+7
| | | | | | Style(9) prefers NULL. Sponsored by: The FreeBSD Foundation
* Welcome 2022, update copyrights.Warner Losh2022-01-012-3/+3
| | | | Sponsored by: Netflix
* sys/kern/sched_4bsd.c: fix typo introduced in previous commitStefan Eßer2022-01-011-1/+1
|
* Restore variable aliasing in the context of cpu set operationsStefan Eßer2022-01-013-4/+8
| | | | | A simplification of set operations removed side-effects of the previous code, which are restored by this commit.
* fusefs: implement VOP_ALLOCATEAlan Somers2022-01-0111-27/+593
| | | | | | | | | Now posix_fallocate will be correctly forwarded to fuse file system servers, for those that support it. MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D33389
* amd64 get_mcontext(): third argument to get_fpcontext() is a pointerKonstantin Belousov2022-01-011-1/+1
| | | | | | | Use NULL instead of raw 0 Sponsored by: The FreeBSD Foundation MFC after: 3 days
* fusefs: fix .. lookups when the parent has been reclaimed.Alan Somers2022-01-012-8/+221
| | | | | | | | | | | | | | | | | | By default, FUSE file systems are assumed not to support lookups for "." and "..". They must opt-in to that. To cope with this limitation, the fusefs kernel module caches every fuse vnode's parent's inode number, and uses that during VOP_LOOKUP for "..". But if the parent's vnode has been reclaimed that won't be possible. Previously we paniced in this situation. Now, we'll return ESTALE instead. Or, if the file system has opted into ".." lookups, we'll just do that instead. This commit also fixes VOP_LOOKUP to respect the cache timeout for ".." lookups, if the FUSE file system specified a finite timeout. PR: 259974 MFC after: 2 weeks Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D33239
* fusefs: move common code from forget.cc to utils.ccAlan Somers2022-01-013-8/+15
| | | | MFC after: 2 weeks
* fusefs: in the tests, always assume debug.try_reclaim_vnode is availableAlan Somers2022-01-011-4/+0
| | | | | | | | In an earlier version of the revision that created that sysctl (D20519) the sysctl was gated by INVARIANTS, so the test had to check for it. But in the committed version it is always available. MFC after: 2 weeks
* fusefs: copy_file_range must update file timestampsAlan Somers2022-01-012-0/+144
| | | | | | | | | If FUSE_COPY_FILE_RANGE returns successfully, update the atime of the source and the mtime and ctime of the destination. MFC after: 2 weeks Reviewers: pfg Differential Revision: https://reviews.freebsd.org/D33159
* Fix a race in fusefs that can corrupt a file's size.Alan Somers2022-01-018-9/+516
| | | | | | | | | | | | | | | | | | | | | | | | | | VOPs like VOP_SETATTR can change a file's size, with the vnode exclusively locked. But VOPs like VOP_LOOKUP look up the file size from the server without the vnode locked. So a race is possible. For example: 1) One thread calls VOP_SETATTR to truncate a file. It locks the vnode and sends FUSE_SETATTR to the server. 2) A second thread calls VOP_LOOKUP and fetches the file's attributes from the server. Then it blocks trying to acquire the vnode lock. 3) FUSE_SETATTR returns and the first thread releases the vnode lock. 4) The second thread acquires the vnode lock and caches the file's attributes, which are now out-of-date. Fix this race by recording a timestamp in the vnode of the last time that its filesize was modified. Check that timestamp during VOP_LOOKUP and VFS_VGET. If it's newer than the time at which FUSE_LOOKUP was issued to the server, ignore the attributes returned by FUSE_LOOKUP. PR: 259071 Reported by: Agata <chogata@moosefs.pro> Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33158
* mips: remove forgotten options file tooWarner Losh2021-12-311-162/+0
| | | | Sponsored by: Netflix
* netfpga10: mips only, removeWarner Losh2021-12-315-1272/+0
| | | | Sponsored by: Netflix
* mips: Remove dtrace build supportWarner Losh2021-12-311-2/+0
| | | | Sponsored by: Netflix
* mips: Remove system module supportWarner Losh2021-12-311-16/+4
| | | | | | | Remove all mips .if conditionals. Since _sym was now set unconditionally, just add it to the right place w/o a variable. Sponsored by: Netflix
* callout: Wait for the softclock thread to switch before reschedulingMark Johnston2021-12-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a softclock thread prepares to go off-CPU, the following happens in the context of the thread: 1. callout state is locked 2. thread state is set to IWAIT 3. thread lock is switched from the tdq lock to the callout lock 4. tdq lock is released 5. sched_switch() sets td_lock to &blocked_lock 6. sched_switch() releases old td_lock (callout lock) 7. sched_switch() removes td from its runqueue 8. cpu_switch() sets td_lock back to the callout lock Suppose a timer interrupt fires while the softclock thread is switching off, and callout_process() schedules the softclock thread. Then there is a window between steps 5 and 8 where callout_process() can call sched_add() while td_lock is &blocked_lock, but this is not correct since the thread is not logically locked. callout_process() thus needs to spin waiting for the softclock thread to finish switching off (i.e., after step 8 completes) before rescheduling it, since callout_process() does not acquire the thread lock directly. Reported by: syzbot+fb44dbf6734ff492c337@syzkaller.appspotmail.com Fixes: 74cf7cae4d22 ("softclock: Use dedicated ithreads for running callouts.") Reviewed by: mav, kib, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33709
* Add lio back to NOTESWarner Losh2021-12-311-0/+1
| | | | | | | lio appears to be partially removed from this file. It's a modern enough card, so add it back. It builds everywhere. Sponsored by: Netflix
* rescue: include ping iff at least one of INET & INET6 is enabledEd Maste2021-12-311-1/+5
| | | | | | | | | | | Ping does not build (and serves no purpose) if neither is enabled (i.e., building WITHOUT_INET and WITHOUT_INET6). This is equvalent to a4ef9e58bc0c but for rescue/. PR: 260082 Fixes: a4ef9e58bc0c ("sbin: build ping if at least one of...") Sponsored by: The FreeBSD Foundation
* libc: Some enhancements to syslog(3)Dmitry Wagin2021-12-311-1/+14
| | | | | | | | | | This is a re-application of commit 2d82b47a5b4ef18550565dd55628d51f54d0af2e, which was reverted since it broke with syslog daemons that don't adjust the /dev/log recv buffer size. Now that the default is large enough to accomodate 8KB messages, restore support for large messages. PR: 260126
* ctfconvert: Handle arrays of empty structsMark Johnston2021-12-311-2/+10
| | | | | | | | | | | Members with such a type will legitimately have a size of zero, so don't emit a warning. PR: 260818 Reviewed by: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33700
* exec: Simplify sv_copyout_strings implementations a bitMark Johnston2021-12-316-70/+33
| | | | | | | | | | | | Simplify control flow around handling of the execpath length and signal trampoline. Cache the sysentvec pointer in a local variable. No functional change intended. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33703
* CAM: List few missed opcodes.Alexander Motin2021-12-312-1/+5
| | | | MFC after: 1 weeks
* sys/cpuset.h: fix macro definitionStefan Eßer2021-12-311-1/+1
| | | | | | The _s parameter was missing in the paramater list. Reported by: gljennjohn at gmail.com (Gary Jennejohn)
* iwlwifi: import correct firmware versions for select Intel iwlwifi/mvmBjoern A. Zeeb2021-12-319-3/+3
| | | | | | | | | | | The firmware files for 3160, 7260, and 7265 imported contain old versions no longer supported by the driver. Replace with latest versions from linux-firmware to possibly also support these chip revisions. Reported by: FreeBSD User (freebsd walstatt-de.de) on wireless (2021-12-30) Sponsored by: The FreeBSD Foundation MFC after: 3 days
* LinuxKPI: 802.11 fix queue waitBjoern A. Zeeb2021-12-311-2/+2
| | | | | | | | | | | | We are using a bandaid to wait for queues after station creation looping and pausing. The abort condition was looping in the wrong direction so we were potentially waiting forever if queues never became ready. From initial user test data we also found that the wait time was too low in some cases so increase the length. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* sys/cpuset.h: add 3 more macros provided by GLIBCStefan Eßer2021-12-311-0/+4
| | | | | | | | The lang/python* ports failed since they expected CPU_COUNT_S() to be provided by sys/cpuset.h. Add this function plus 2 more in a way that is compatible with GLIBC. Reported by: ler at lerctr.org (Larry Rosenman)
* x86-busdma - Add missing parenDoug Moore2021-12-311-1/+1
| | | | | Reported by: jenkins Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere
* riscv-busdma: Balance parens.Doug Moore2021-12-311-1/+1
| | | | | Reported by: jenkins Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere
* ar71xx: Remove atheros modulesWarner Losh2021-12-313-116/+0
| | | | | | These are mips only for the atheros MIPS-based SoCs. Sponsored by: Netflix
* iommu_gas: Rename a function missed earlierDoug Moore2021-12-311-1/+1
| | | | | Reported by: jenkins Fixes: c606ab59e7f9 vm_extern: use standard address checkers everywhere
* hwpmc: deorbit mips supportWarner Losh2021-12-319-2184/+0
| | | | Sponsored by: Netflix