aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix definitions for Linux getcpu(2).Edward Tomasz Napierala2019-12-312-2/+4
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356229
* MFV r356143:Cy Schubert2019-12-3199-2003/+3924
|\ | | | | | | | | | | | | | | | | | | Update unbound 1.9.2 --> 1.9.6. MFC after: 3 days Security: CVE-2019-18934 (fixed by 1.9.5) Notes: svn path=/head/; revision=356228
| * Vendor import of Unbound 1.9.6.vendor/unbound/1.9.6Cy Schubert2019-12-28119-6403/+8606
| | | | | | | | | | Notes: svn path=/vendor/unbound/dist/; revision=356143 svn path=/vendor/unbound/1.9.6/; revision=356144; tag=vendor/unbound/1.9.6
* | Add flags for upcoming patches related to improved ECN handling.Michael Tuexen2019-12-312-1/+6
| | | | | | | | | | | | | | | | | | | | No functional change. Submitted by: Richard Scheffenegger Reviewed by: rgrimes@, tuexen@ Differential Revision: https://reviews.freebsd.org/D22429 Notes: svn path=/head/; revision=356227
* | Clear the flag indicating that the last received packet was marked CE alsoMichael Tuexen2019-12-311-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | in the case where a packet not marked was received. Submitted by: Richard Scheffenegger Reviewed by: rgrimes@, tuexen@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19143 Notes: svn path=/head/; revision=356226
* | psm: properly check for atkbdc_open failureKyle Evans2019-12-311-0/+2
| | | | | | | | | | | | | | | | atkbdc_open can return NULL if the unit's out of bounds or the softc isn't setup. Check it to be safe. Notes: svn path=/head/; revision=356225
* | Add curly braces missed in https://svnweb.freebsd.org/changeset/base/354773Michael Tuexen2019-12-311-1/+2
| | | | | | | | | | | | | | | | Sponsored by: Netflix, Inc. CID: 1407649 Notes: svn path=/head/; revision=356224
* | riscv: Remove unused variableKristof Provost2019-12-311-1/+1
| | | | | | | | | | | | | | Fix the build that was broken by r356221. Pointy hat to myself. Notes: svn path=/head/; revision=356223
* | sifive: uart driverKristof Provost2019-12-312-0/+544
| | | | | | | | | | | | | | | | | | | | | | Implement support for the UART as found on the SiFive FU540. It should also work on, but has not been tested with, the FU310. Reviewed by: philip Sponsored by: Axiado Notes: svn path=/head/; revision=356222
* | riscv: Remove pointless loopKristof Provost2019-12-311-6/+1
| | | | | | | | | | | | | | | | | | | | | | There's no point in checking for absent CPUs if we're not going to do anything about either the present or absent case. This loop can just be removed. Reviewed by: philip Sponsored by: Axiado Notes: svn path=/head/; revision=356221
* | rtld(1): Do booleans like C99Conrad Meyer2019-12-311-5/+1
| | | | | | | | | | | | | | | | Reviewed by: kib, rlibby Differential Revision: https://reviews.freebsd.org/D22964 Notes: svn path=/head/; revision=356220
* | Switch r356210 to use gone_in() instead of printf().Rick Macklem2019-12-311-2/+1
| | | | | | | | | | | | | | Suggested by: cem Notes: svn path=/head/; revision=356219
* | inetd: prefer strlcpy to strlen(3) check + strcpy(3), NFCKyle Evans2019-12-311-6/+9
| | | | | | | | | | | | | | This is again functionally equivalent but more concise. Notes: svn path=/head/; revision=356218
* | inetd: prefer strtonum(3) to strspn(3)+atoi(3), NFCKyle Evans2019-12-311-2/+8
| | | | | | | | | | | | | | | | strtonum(3) does effectively the same validation as we had, but it's more concise. Notes: svn path=/head/; revision=356217
* | Don't spin on cleanup_lock if we are not interrupt.Alexander Motin2019-12-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If somebody else holds that lock, it will likely do the work for us. If it won't, then we return here later and retry. Under heavy load it allows to avoid lock congestion between interrupt and polling threads. MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356216
* | inetd: knock out some clang analyze warningsKyle Evans2019-12-312-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chargen_dg: clang-analyze is convinced that endring could be non-NULL at entry, and thus wants to assume that rs == NULL. Just independently initialize rs if it's NULL to appease the analyzer. getconfigent: policy leaks on return free_connlist: reorganize the loop to make it clear that we're not going to access `conn` after it's been freed. cpmip/hashval: left-shifts performed will result in UB as we take signed 0xABC3D20F and left shift it by 5. Notes: svn path=/head/; revision=356215
* | Avoid few memory accesses in g_disk_done().Alexander Motin2019-12-311-5/+7
| | | | | | | | Notes: svn path=/head/; revision=356214
* | Replace .h files included from old NFS directories with the new NFS ones.Rick Macklem2019-12-311-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch, nfsstat.c includes files from sys/nfs, sys/nfsclient and sys/nfsserver. These .h files (particularily the ones in sys/nfsclient and sys/nfsserver) are from the old NFS code and should eventually be deprecated/removed. This patch changes nfsstat.c to include files from the new/current NFS code instead of the old ones in preparation for eventual removal. Notes: svn path=/head/; revision=356213
* | MFV r356163,r356197:Martin Matuska2019-12-3148-295/+1178
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update libarchive to 3.4.1 Relevant vendor changes since last update: Issue #351: Refactor and implement private state logic for write filters PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482) PR #1255: zip writer - don't append unused NUL for directories PR #1260: Fix sparse file offset overflow on 32-bit systems PR #1263: UNICODE filename support for reading lha/lzh format Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs() PR #1288: Add the "xattrhdr" option to pax write options PR #1295: 7z reader - fix reading archives with digests in PackInfo PR #1296: RAR5 reader - verify window size for multivolume archives PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs() OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error Fix possible off-by-one when dealing with readlink(2) MFC after: 2 weeks Notes: svn path=/head/; revision=356212
| * | Update vendor/libarchive/dist to git 1dae5a549fe4ab99fd3a49a9edcf897a7b2b1844Martin Matuska2019-12-2851-364/+1346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relevant vendor changes: Issue #351: Refactor and implement private state logic for write filters PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482) PR #1255: zip writer - don't append unused NUL for directories PR #1260: Fix sparse file offset overflow on 32-bit systems PR #1263: UNICODE filename support for reading lha/lzh format Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs() PR #1288: Add the "xattrhdr" option to pax write options PR #1295: 7z reader - fix reading archives with digests in PackInfo PR #1296: RAR5 reader - verify window size for multivolume archives PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs() OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error Fix possible off-by-one when dealing with readlink(2) Notes: svn path=/vendor/libarchive/dist/; revision=356163
* | | Set a "kernbase" symbol in 32-bit arm locore.S and use it with ldscript.arm.Ian Lepore2019-12-303-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings arm into line with how every other arch does it. For some reason, only arm lacked a definition of a symbol named kernbase in its locore.S file(s) for use in its ldscript.arm file. Needlessly different means harder to maintain. Using a common symbol name also eases work in progress on a script to help generate arm and arm64 kernels packaged in various ways (like with a header blob needed for a bootloader prepended to the kernel file). Notes: svn path=/head/; revision=356211
* | | Add warning printf w.r.t. removal of sys/nfs/nfs_lock.c.Rick Macklem2019-12-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in sys/nfs/nfs_lock.c has not been run by default since March 2008 when it was replaced by the in kernel sys/nlm code. It uses Giant, so it needs to be removed before the FreeBSD 13 release. This will happen in a couple of months, since few if any users run the code anyhow and can easily switch to the default in kernel NFSLOCKD. Notes: svn path=/head/; revision=356210
* | | Formatting fixes for tables, no content changes.John Baldwin2019-12-301-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add missing .Pp after the end of some lists so that there is a blank line before the subsequent paragraph. - Use a more typical '-tag' bullet list of the make variable descriptions at the end. This adds separation between bullets and is the formatting typically used in manpages for this sort of list. Notes: svn path=/head/; revision=356209
* | | sh: Test that executing various binary files is rejectedJilles Tjoelker2019-12-305-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If executing a file fails with an [ENOEXEC] error, the shell executes the file as a shell script, except that this execution may instead result in an error message if the file is binary. Per a recent Austin Group interpretation, we will need to change this to allow a concatenation of a shell script and a binary payload. See Austin Group bugs #1226 and #1250. MFC after: 1 week Notes: svn path=/head/; revision=356208
* | | Determine whether the MMU hardware is capable of updating a page tableAlan Cox2019-12-303-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entry's access flag and dirty state, and enable this feature when it's available. Ensure that we don't overlook a dirty state update that is concurrent with a call to pmap_enter(). (Previously, all dirty state updates would have occurred with the containing pmap's lock held, so a page table entry's dirty state could not have changed while pmap_enter() held that same lock.) Reviewed by: andrew, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22907 Notes: svn path=/head/; revision=356207
* | | linux(4): implement copy_file_range(2)Pawel Biernacki2019-12-305-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | copy_file_range(2) is implemented natively since r350315, make it available for Linux binaries too. Reviewed by: kib (mentor), trasz (previous version) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D22959 Notes: svn path=/head/; revision=356206
* | | Don't hard-code field offsets of struct riscv_bootparams.Ruslan Bukin2019-12-302-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: James Clarke <jrtc27@jrtc27.com> Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22970 Notes: svn path=/head/; revision=356205
* | | inetd: don't leak `policy` on returnKyle Evans2019-12-301-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sep->se_policy gets a strdup'd version of policy, so we don't need it to stick around afterwards. While here, remove a couple of NULL checks prior to free(policy). CID: 1006865 MFC after: 3 days Notes: svn path=/head/; revision=356204
* | | Don't hard-code size of struct riscv_bootparams.Ruslan Bukin2019-12-302-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: James Clarke <jrtc27@jrtc27.com> Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22968 Notes: svn path=/head/; revision=356203
* | | Round the kernel stack allocation up as required.Ruslan Bukin2019-12-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: James Clarke <jrtc27@jrtc27.com> Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22961 Notes: svn path=/head/; revision=356202
* | | Fix spelling.Hans Petter Selasky2019-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 242891 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356201
* | | Use atomic for start_count in devstat_start_transaction().Alexander Motin2019-12-307-56/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combined with earlier nstart/nend removal it allows to remove several locks from request path of GEOM and few other places. It would be cool if we had more SMP-friendly statistics, but this helps too. Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356200
* | | [PowerPC] Fix panic when attempting to handle an HMI from an idle threadBrandon Bergren2019-12-302-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In IRC, sfs_ finally managed to get a good trace of a kernel panic that was happening when attempting to use webengine. As it turns out, we were using vtophys() from interrupt context on an idle thread in opal_hmi_handler2(). Since this involves locking the kernel pmap on PPC64 at the moment, this ended up tripping a KASSERT in mtx_lock(), which then caused a parallel panic stampede. So, avoid this by preallocating the flags variable and storing it in PCPU. Fixes "panic: mtx_lock() by idle thread 0x... on sleep mutex kernelpmap". Differential Revision: https://reviews.freebsd.org/D22962 Notes: svn path=/head/; revision=356199
* | | sc(4) md bits: stop setting sc->kbd entirelyKyle Evans2019-12-305-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | The machdep parts no longer need to touch keyboard parts after r356043; sc->kbd will be 0-initialized and this works as expected. Notes: svn path=/head/; revision=356196
* | | virtio_random(4): Drop no longer needed unload kludgeConrad Meyer2019-12-301-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After r356194, source deregistration no longer races with concurrent use. Reviewed by: bryanv, markm Differential Revision: https://reviews.freebsd.org/D22490 Notes: svn path=/head/; revision=356195
* | | random(4): Make entropy source deregistration safeConrad Meyer2019-12-301-10/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow loadable modules that provide random entropy source(s) to safely unload. Prior to this change, no driver could ensure that their random_source structure was not being used by random_harvestq.c for any period of time after invoking random_source_deregister(). This change converts the source_list LIST to a ConcurrencyKit CK_LIST and uses an epoch(9) to protect typical read accesses of the list. The existing HARVEST_LOCK spin mutex is used to safely add and remove list entries. random_source_deregister() uses epoch_wait() to ensure no concurrent source_list readers are accessing a random_source before freeing the list item and returning to the caller. Callers can safely unload immediately after random_source_deregister() returns. Reviewed by: markj Approved by: csprng(markm) Discussed with: jhb Differential Revision: https://reviews.freebsd.org/D22489 Notes: svn path=/head/; revision=356194
* | | Retire nstart/nend counters.Alexander Motin2019-12-304-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those counters were abused for decade to workaround broken orphanization process in different classes by delaying the call while there are active requests. But from one side it did not close all the races, while from another was quite expensive on SMP due to trashing twice per request cache lines of consumer and provider and requiring locks. It lost its sense after I manually went through all the GEOM classes in base and made orphanization wait for either provider close or request completion. Consumer counters are still used under INVARIANTS to detect premature consumer close and detach. Provider counters are removed completely. Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356192
* | | Add libdtrace support for arm64 USDT probes.Mark Johnston2019-12-291-8/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arm64 is still lacking a fasttrap implementation, which is required to actually enable userland probes, but this at least allows USDT probes to be linked into userland applications. Submitted by: Klaus Küchemann <maciphone2@googlemail.com> (original) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22360 Notes: svn path=/head/; revision=356187
* | | Add ARMv8 static relocation types used for control flow instructions.Mark Johnston2019-12-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356186
* | | Remove GEOM_SCHED class and gsched tool.Alexander Motin2019-12-2922-3637/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was not actively maintained since it was introduced 10 years ago. It lacks support for many later GEOM features, such as direct dispatch, unmapped I/O, stripesize/stripeoffset, resize, etc. Plus it is the only remaining use of GEOM nstart/nend request counters, used there to implement live insertion/removal, questionable by itself. Plus, as number of people commented, GEOM is not the best place for I/O scheduler, since it has limited information about layers both above and below it, required for efficient scheduling. Plus with the modern shift to SSDs there is just no more significant need for this kind of scheduling. Approved by: imp, phk, luigi Relnotes: yes Notes: svn path=/head/; revision=356185
* | | powerd(8): Fix a memory leak when we fail to read frequency levels.Mark Johnston2019-12-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 242967 Submitted by: Hans Christian Woithe <chwoithe@yahoo.com> MFC after: 3 days Notes: svn path=/head/; revision=356184
* | | Restore a vm_page_wired() check in vm_page_mvqueue() after r356156.Mark Johnston2019-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now set PGA_DEQUEUE on a managed page when it is wired after allocation, and vm_page_mvqueue() ignores pages with this flag set, ensuring that they do not end up in the page queues. However, this is not sufficient for managed fictitious pages or pages managed by the TTM. In particular, the TTM makes use of the plinks.q queue linkage fields for its own purposes. PR: 242961 Reported and tested by: Greg V <greg@unrelenting.technology> Notes: svn path=/head/; revision=356183
* | | Missed part of r356162.Alexander Motin2019-12-291-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we postpone consumer destruction till close, then the close calls should not be ignored. Delay geom withering till the last close too. MFC after: 2 weeks X-MFC-with: r356162 Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356182
* | | Fix GEOM_VIRSTOR orphanization.Alexander Motin2019-12-291-30/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code closed and destroyed consumer even with I/O in progress. This patch postpones the destruction till the last close. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356181
* | | Eliminate the generated ldscript for arm and arm64, and strip $a/$d markerIan Lepore2019-12-294-34/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | symbols from the linked kernel. The main thrust of this change is to generate a kernel that has the arm "marker" symbols stripped. Marker symbols start with $a, $d, $t or $x, and are emitted by the compiler to tell other toolchain components about the locations of data embedded in the instruction stream (literal-pool stuff). They are used for generating mixed-endian binaries (which we don't support). The linked kernel has approximately 21,000 such symbols in it, wasting space (500K in kernel.full, 190K in the final linked kernel), and sometimes obscuring function names in stack tracebacks. This change also simplifies the way the kernel is linked. Instead of using sed to generate two different ldscript files to generate both an elf kernel and a binary (elf headers stripped) kernel, we now use a single ldscript that refers to a "text_start" symbol, and we provide the value for that symbol using --defsym on the linker command line. Notes: svn path=/head/; revision=356180
* | | sysctlbyname(2): Remove temporary compatibility layerPawel Biernacki2019-12-291-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove temporary compatibility layer introduced in r351729. More that 3 months should be enough for everybody who runs HEAD to upgrade to the new kernel already. Reviewed by: imp, mjg (mentor) Approved by: mjg (mentor) Differential Revision: https://reviews.freebsd.org/D22958 Notes: svn path=/head/; revision=356179
* | | Fix GEOM_MOUNTVER orphanization.Alexander Motin2019-12-291-15/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous code closed and detached consumer even with I/O still in progress. This patch adds locking and request counting to postpone the close till the last of running requests completes. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=356178
* | | Implement Linux syslog(2) syscall; just enough to make Linux dmesg(8)Edward Tomasz Napierala2019-12-296-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | utility work. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22465 Notes: svn path=/head/; revision=356177
* | | gnop: change the "count until fail" optionMariusz Zaborski2019-12-292-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the "count_until_fail" option of gnop, now it enables the failing rating instead of setting them to 100%. The original patch introduced the new flag, which sets the fail/rate to 100% after N requests. In some cases, we don't want to have 100% of failure probabilities. We want to start failing at some point. For example, on the early stage, we may like to allow some read/writes requests before having some requests delayed - when we try to mount the partition, or when we are trying to import the pool. Another case may be to check how scrub in ZFS will behave on different stages. This allows us to cover more cases. The previous behavior still may be configured. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22632 Notes: svn path=/head/; revision=356176
* | | Make linprocfs(5) provide an empty /proc/modules. This should silenceEdward Tomasz Napierala2019-12-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some warnings. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356175