]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoSome minor tweaks to arch(7).
jhb [Thu, 2 Jan 2020 16:27:15 +0000 (16:27 +0000)]
Some minor tweaks to arch(7).

- Drop mention of _LP64.  FreeBSD's source generally uses __LP64__
  instead of _LP64, and the relevant macros are better covered in the
  "Predefined Macros" section.
- Fix a noun/verb disagreement.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22975

4 years agoSince arm/unwind.c s conditionally compiled, only call functions in it
ian [Thu, 2 Jan 2020 15:38:17 +0000 (15:38 +0000)]
Since arm/unwind.c s conditionally compiled, only call functions in it
when one of those conditions is true.  Fixes build failure on kernel
configs with no debugging options active.

4 years agoRemove empty line which was added in r356270 by accident.
tuexen [Thu, 2 Jan 2020 14:04:16 +0000 (14:04 +0000)]
Remove empty line which was added in r356270 by accident.

MFC after: 1 week

4 years agoImprove input validation of the spp_pathmtu field in the
tuexen [Thu, 2 Jan 2020 13:55:10 +0000 (13:55 +0000)]
Improve input validation of the spp_pathmtu field in the
SCTP_PEER_ADDR_PARAMS socket option. The code in the stack assumes
sane values for the MTU.

This issue was found by running an instance of syzkaller.

MFC after: 1 week

4 years agoAdd the missing trailing '/' when setting TARGET_ARCH from TARGET
andrew [Thu, 2 Jan 2020 11:02:09 +0000 (11:02 +0000)]
Add the missing trailing '/' when setting TARGET_ARCH from TARGET

This should fix the build when setting TARGET but not TARGET_ARCH.

Sponsored by: DARPA, AFRL

4 years agoPlug loopback idaddr refcount leak.
melifaro [Thu, 2 Jan 2020 09:08:45 +0000 (09:08 +0000)]
Plug loopback idaddr refcount leak.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22980

4 years agoAdd a compact columnar output format, available by specifying a second '-l'
scottl [Thu, 2 Jan 2020 06:56:28 +0000 (06:56 +0000)]
Add a compact columnar output format, available by specifying a second '-l'
command line option.  Thanks to the removal of unnecessary information and
the organization into columns, this helps the output be more legible on
both 80 column displays and non-80 column displays.  imp@ provided the
idea on this.

4 years agoMove stand/ofw/libofw to stand/libofw.
bdragon [Thu, 2 Jan 2020 04:34:22 +0000 (04:34 +0000)]
Move stand/ofw/libofw to stand/libofw.

Since rS330365, there has been no particular reason for libofw to be in a
subdirectory of ofw. Move libofw up a level to make it fit in better with
the other top level libraries.

Also add a LIBOFWSRC to stand/defs.mk to match what all the other
libraries are doing.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D23000

4 years agoRemove MACHINE_ARCH arm where appropriate from the tables to reflect armv5's
imp [Thu, 2 Jan 2020 03:25:37 +0000 (03:25 +0000)]
Remove MACHINE_ARCH arm where appropriate from the tables to reflect armv5's
retirement.

4 years agoRemove NOTES.armv5. It's no longer relevant.
imp [Thu, 2 Jan 2020 03:25:32 +0000 (03:25 +0000)]
Remove NOTES.armv5. It's no longer relevant.

4 years agoRemove arm/arm as a valid target.
imp [Thu, 2 Jan 2020 03:25:26 +0000 (03:25 +0000)]
Remove arm/arm as a valid target.

TARGET=arm now defaults to TARGET_ARCH=armv7
TARGET_ARCH=arm is no longer valid.

Bump __FreeBSD_version to 1300073

Tested with make universe. Any stale LINT-V5 config files remaining in the tree
will fail the universe build. However, LINT-V5 was removed in r355119.

This retirement has been planned since last summer. The armv5 port is fragile:
it works OK for some peeople, and fails badly for others. There's a number of
subtle bugs in busdma, pmap and other MD parts of thee system that present
themselves under load or in unusual circumstances (like fsck after a
crash). stable/8, branched 10 years ago, was the last reliable release.  Since
the support burden is larger then the benefit, the consensus view is armv5
should be removed from the tree.

Discussed with: arm@ mailing list and arm developer community.

4 years agosysctl: hide 2.x era compat node
kaktus [Thu, 2 Jan 2020 01:23:43 +0000 (01:23 +0000)]
sysctl: hide 2.x era compat node

r23081 introduced kern.dummy oid as a semi ABI compat for kern.maxsockbuf
that was moved to a new namespace.  It never functioned as an alias of any
kind and was just returning 0 unconditionally, hence it was probably
provided to keep some 3rd party programmes happy about sysctl(3) not
reporting an error because of non-existing oid.
After nearly 23 years it seems reasonable to just hide it from sysctl(8)
list not to cause unnecessary confusion as for its purpose.

Reported by: Antranig Vartanian <antranigv@freebsd.am>
Reviewed by: kib (mentor)
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D22982

4 years agovfs: drop an always-false check from vlrureclaim
mjg [Wed, 1 Jan 2020 22:51:17 +0000 (22:51 +0000)]
vfs: drop an always-false check from vlrureclaim

The vnode gets held few lines prior, making the VI_FREE condition
illegal.

4 years agomsdos: vgone unconstructed vnode before vputing it
mjg [Wed, 1 Jan 2020 22:50:23 +0000 (22:50 +0000)]
msdos: vgone unconstructed vnode before vputing it

Otherwise someone else may race to start using it. Race window
was opened by r351748 ("vfs: implement usecount implying holdcnt").

Noted by: kib

4 years agomsdosfs: add a missing MNT_VNODE_FOREACH_ALL_ABORT to msdosfs_sync
mjg [Wed, 1 Jan 2020 22:47:00 +0000 (22:47 +0000)]
msdosfs: add a missing MNT_VNODE_FOREACH_ALL_ABORT to msdosfs_sync

4 years agoMerge commit 468a0cb5f from llvm git (by Craig Topper):
dim [Wed, 1 Jan 2020 19:45:00 +0000 (19:45 +0000)]
Merge commit 468a0cb5f from llvm git (by Craig Topper):

  [X86] Add X87 FCMOV support to X86FlagsCopyLowering.

  Fixes PR44396

Merge commit 86f48999f from llvm git (by Craig Topper):

  [X86] Fix typo in getCMovOpcode.

  The 64-bit HasMemoryOperand line was using CMOV32rm instead of
  CMOV64rm. Not sure how to test this. We have no test coverage that
  passes true for HasMemoryOperand.

This fixes 'Assertion failed: (MI.findRegisterDefOperand(X86::EFLAGS) &&
"Expected a def of EFLAGS for this instruction!"), function
runOnMachineFunction' when compiling the misc/gpsim port for i386.

Reported by: yuri
Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=44396
MFC after: 1 week

4 years agoinetd: final round of trivial cleanup, NFC
kevans [Wed, 1 Jan 2020 18:49:57 +0000 (18:49 +0000)]
inetd: final round of trivial cleanup, NFC

Highlights:
- Use MAX() for maxsock raising; small readability improvement IMO
- malloc(3) + memset(3) -> calloc(3) where appropriate
- stop casting the return value of malloc(3)
- mallloc(3) -> reallocarray(3) where appropriate

A future change may enter capability mode when forking for some of the
built-in handlers.

4 years agoIn r343631 error code for a packet blocked by a firewall was
glebius [Wed, 1 Jan 2020 17:32:20 +0000 (17:32 +0000)]
In r343631 error code for a packet blocked by a firewall was
changed from EACCES to EPERM.  This change was not intentional,
so fix that.  Return EACCESS if a firewall forbids sending.

Noticed by: ae

4 years agoIn r343631 error code for a packet blocked by a firewall was
glebius [Wed, 1 Jan 2020 17:31:43 +0000 (17:31 +0000)]
In r343631 error code for a packet blocked by a firewall was
changed from EACCES to EPERM.  This change was not intentional,
so fix that.  Return EACCESS if a firewall forbids sending.

Noticed by: ae

4 years agosh: Fix rare memory leak with SIGINT
jilles [Wed, 1 Jan 2020 12:06:37 +0000 (12:06 +0000)]
sh: Fix rare memory leak with SIGINT

If getcwd() failed earlier on but later succeeded in the pwd builtin,
there was no INTOFF protection between calling savestr() and storing its
result.

It is quite rare for getcwd() to fail, and rarer for it to succeed later in
the same directory.

Found via code inspection for changing ckmalloc() and similar to assert
INTOFF protection instead of applying it directly (which protects against
corrupting malloc's internal state but allows memory leaks or double frees).

MFC after: 1 week

4 years agoRevert r356249 for now as it broke GCC builds.
delphij [Wed, 1 Jan 2020 09:22:06 +0000 (09:22 +0000)]
Revert r356249 for now as it broke GCC builds.

4 years agoReduce memory footprint of fsck_msdosfs.
delphij [Wed, 1 Jan 2020 07:43:08 +0000 (07:43 +0000)]
Reduce memory footprint of fsck_msdosfs.

This utility was initially written for FAT12/16, which were inherently
small. When FAT32 support was added, the old data structure and
algorithms remain used with minimal changes.

With growing size of FAT32 media, the current data structure that
requires 4 32-bit variables per each FAT32 table entry would consume up
to 4 GiB of RAM, which can be too big for systems with limited RAM
available.

Address this by taking a different approach of validating the FAT.

The FAT is essentially a set of linked lists of chains that was
referenced by directory entries, and the checker needs to make sure that
the linked chains of clusters do not have cross-linked chains, and every
chain were referenced by one and only one directory entry.  Instead of
keeping track of the chain's 'head' cluster number, the size of the
chain, the used status of the chain and the "next" pointer which is
content of the FAT table, we create accessors for the FAT table data
for the "next" pointer, and keep only one bit to indicate if the
current cluster is a 'head' node of a cluster chain, in a bitmap.

We further overhaul the FAT checker to find out the possible head nodes
by excluding ones that are not (in other words, nodes that have some
other nodes claiming them as the next node) instead of marking the head
nodes for each node on the chain.  This approach greatly reduced the
complexiety of computation from O(N^2) worst case, to an O(N) scan for
worst case.  The file (cluster chain) length is not useful for the FAT
checker, so don't bother to calculate them in the FAT checker and
instead leave the task to the directory structure check, at which point
we would have non-crossed cluster chains, and we are guaranteed that
each cluster will be visited for at most one time.

When checking the directory structures, we use the head node indicator
to as the visited (used) flag: every cluster chain can only be
referenced by one directory entry, so we clear them when calculating
the length of the chain, and we can immediately tell if there are
anomalies in the directory entry.

As a result, the required RAM size is now 1 bit per each entry of
the FAT table, plus memory needed to hold the FAT table in memory,
instead of 16 bytes (=128 bits) per each entry.  For FAT12 and FAT16,
we will load the whole FAT table into memory as they are smaller than
128KiB, and for FAT32, we first attempt to mmap() it into memory, and
when that fails, we would fall back to a simple LRU cache of 4 MiB of
RAM.

sbin/fsck_msdosfs/boot.c:

 - Added additional sanity checks for valid FAT32/FAT16/FAT12 cluster
   number.
 - FAT32: check if root directory starts with a valid cluster number,
   moved from dir.c.  There is no point to proceed if the filesystem
   is already damaged beyond repair.

sbin/fsck_msdosfs/check.c:

 - Combine phase 1 and phase 2, now that the readfat() is able to
   detect cross chains.

sbin/fsck_msdosfs/dir.c:

 - Refactor code to use FAT accessor instead of accessing the internal
   representation of FAT table.
 - Make use of the cluster chain head bitmap.
 - Clarify and simplify directory entry check, remove unnecessary
   checks that are would be done at a later time (for example, whether
   the directory's second cluster is a valid one, which is examined
   more throughly in a later checkchain() and does not prevent us
   from proceeding further).

sbin/fsck_msdosfs/dosfs.h:

 - Remove internal representation of FAT table, which is replaced by
   the head bitmap that is opaque to other code.
 - Added a special CLUST_DEAD cluster type to indicate errors.

sbin/fsck_msdosfs/ext.h:

 - Added a flag that overrides mmap(2) setting.  The corresponding
   command line option, -M is intentionally undocumented as we do not
   expect users to need it.
 - Added accessors for FAT table and convert existing interface to use
   it.

sbin/fsck_msdosfs/fat.c:

 - Added head bitmap to represent whether a cluster is a head cluster.
 - Converted FAT internal representation to accessors.
 - Implemented a LRU cache for FAT32 when mmap(2) should not or can not
   be used.
 - _readfat: Attempt a mmap(2) and fall back to regular read for
   non-FAT32 file systems; use the LRU cache for FAT32 and prepopulate
   the cache with the first 4MiB of the entries.
 - readfat: Added support of head bitmap and use the population scan to
   detect bogus chains.
 - clusterdiff: removed, FATs are copied from the checked copy via
   writefat()/copyfat().
 - checkchain: calculates the length of a cluster chain and make sure
   that it ends with a valid EOF marker.
 - clearchain: follow and clear a chain and maintain the free cluster
   count.
 - checklost: convert to use head bitmap. At the end of all other scans,
   the remaining 'head' nodes are leaders of lost cluster chains.

sbin/fsck_msdosfs/fat.c:

 - Added a new -M option which is intentionally undocumented, to disable
   the use of mmap().

Reviewed by: kevlo
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D22965

4 years agoinetd: convert remaining bzero(3) to memset(3), NFC
kevans [Wed, 1 Jan 2020 04:29:08 +0000 (04:29 +0000)]
inetd: convert remaining bzero(3) to memset(3), NFC

This change is purely in the name of noise reduction from static analyzers
that want to complain that bzero(3) is obsolete in favor of memset(3).

With this, clang-analyze at least is now noise free. WARNS= 6 also appears
to have been OK for some time now, so drop the current setting and opt for
the default.

4 years agoinetd: track all child pids, regardless of maxchild spec
kevans [Wed, 1 Jan 2020 04:22:04 +0000 (04:22 +0000)]
inetd: track all child pids, regardless of maxchild spec

Currently, child pids are only tracked if maxchildren is specified. As a
consequence, without a maxchild limit we do not get a notice in syslog on
children aborting abnormally. This turns out to be a great debugging aide at
times.

Children are now tracked in a LIST; the management interface is decidedly
less painful when there's no upper bound on the number of entries we may
have at the cost of one small allocation per connection.

PR: 70335

4 years agoinetd: add some macros for checking child limits, NFC
kevans [Wed, 1 Jan 2020 03:59:54 +0000 (03:59 +0000)]
inetd: add some macros for checking child limits, NFC

The main point here is capturing the maxchild > 0 check. A future change to
inetd will start tracking all of the child pids so that it can give proper
and consistent notification of process exit/signalling.

4 years agovmgenid(4): Integrate as a random(4) source
cem [Wed, 1 Jan 2020 00:35:02 +0000 (00:35 +0000)]
vmgenid(4): Integrate as a random(4) source

The number is public and has no "entropy," but should be integrated quickly
on VM rewind events to avoid duplicate sequences.

Approved by: csprng(markm)
Differential Revision: https://reviews.freebsd.org/D22946

4 years agoUpdate the man page to reflect that "-M" and "-N" are deprecated and ignored.
rmacklem [Tue, 31 Dec 2019 22:25:06 +0000 (22:25 +0000)]
Update the man page to reflect that "-M" and "-N" are deprecated and ignored.

r356242 updated nfsstat.c to report that the "-M" and "-N" options were
being ignored. These options have never had any meaning for the new NFS
code (which is now the only NFS code).
This patch updates the man page to reflect this.

This is a content change.

4 years agoThe map-entry clipping functions modify start and end entries of an
dougm [Tue, 31 Dec 2019 22:20:54 +0000 (22:20 +0000)]
The map-entry clipping functions modify start and end entries of an
entry in the vm_map, making invariants related to the max_free entry
field invalid. Move the clipping work into vm_map_entry_link, so that
linking is okay when the new entry clips a current entry, and the
vm_map doesn't have to be briefly corrupted. Change assertions and
conditions in SPLAY_{LEFT,RIGHT}_STEP since the max_free invariants
can now be trusted in all cases.

Tested by: pho
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D22897

4 years agoGet rid of old nfsstat options no longer used.
rmacklem [Tue, 31 Dec 2019 22:19:33 +0000 (22:19 +0000)]
Get rid of old nfsstat options no longer used.

The "-M" and "-N" options for nfsstat were used by the old NFS code and
have never done anything for the new NFS code.
This patch replaces code that assigns values to variables that are never
used with printf()s noting the options are ignored.
This has the side effect that it gets rid of warnings w.r.t. these
variables being assigned but never used, that occur for some builds.

Noticed during integration of the NFSv4.2 code.

4 years agoAdd basic getcpu(2) support to linuxulator. The purpose of this
trasz [Tue, 31 Dec 2019 22:01:08 +0000 (22:01 +0000)]
Add basic getcpu(2) support to linuxulator.  The purpose of this
syscall is to query the CPU number and the NUMA domain the calling
thread is currently running on.  The third argument is ignored.
It doesn't do anything regarding scheduling - it's literally
just a way to query the current state, without any guarantees
you won't get rescheduled an opcode later.

This unbreaks Java from CentOS 8
(java-11-openjdk-11.0.5.10-0.el8_0.x86_64).

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22972

4 years agoRelax locking of carp_forus().
mav [Tue, 31 Dec 2019 18:58:29 +0000 (18:58 +0000)]
Relax locking of carp_forus().

This fixes deadlock between CARP and bridge.  Bridge calls this function
taking CARP lock while holding bridge lock.  Same time CARP tries to send
its announcements via the bridge while holding CARP lock.

Use of CARP_LOCK() here does not solve anything, since sc_addr is constant
while race on sc_state is harmless and use of the lock does not close it.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoFix NOINET6 build broken by r356236.
melifaro [Tue, 31 Dec 2019 17:57:12 +0000 (17:57 +0000)]
Fix NOINET6 build broken by r356236.

MFC after: 2 weeks

4 years agoSplit gigantic rtsock route_output() into smaller functions.
melifaro [Tue, 31 Dec 2019 17:26:53 +0000 (17:26 +0000)]
Split gigantic rtsock route_output() into smaller functions.

Amount of changes to the original code has been intentionally minimised
to ease diffing.
The changes are mostly mechanical, with the following exceptions:

* lltable handler is now called directly based of RTF_LLINFO flag presense.
* "report" logic for updating rtm in RTM_GET/RTM_DELETE has been simplified,
  fixing several potential use-after-free cases in rt_addrinfo.
* llable asserts has been replaced with error-returning, preventing kernel
  crashes when lltable gw af family is invalid (root required).

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22864

4 years agoFix delayed ACK generation for DCTCP.
tuexen [Tue, 31 Dec 2019 16:15:47 +0000 (16:15 +0000)]
Fix delayed ACK generation for DCTCP.

Submitted by: Richard Scheffenegger
Reviewed by: chengc@netapp.com, rgrimes@, tuexen@
Differential Revision: https://reviews.freebsd.org/D22644

4 years agoRegen after r356233.
trasz [Tue, 31 Dec 2019 16:07:12 +0000 (16:07 +0000)]
Regen after r356233.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoSigh, add getcpu(2) chunk missed in r356229.
trasz [Tue, 31 Dec 2019 16:05:07 +0000 (16:05 +0000)]
Sigh, add getcpu(2) chunk missed in r356229.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoRegen after r356229.
trasz [Tue, 31 Dec 2019 16:01:37 +0000 (16:01 +0000)]
Regen after r356229.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoHappy New Year 2020!
gjb [Tue, 31 Dec 2019 16:01:36 +0000 (16:01 +0000)]
Happy New Year 2020!

MFC after: 1 minute
Sponsored by: Rubicon Communications, LLC (netgate.com)

4 years agoFix definitions for Linux getcpu(2).
trasz [Tue, 31 Dec 2019 15:57:29 +0000 (15:57 +0000)]
Fix definitions for Linux getcpu(2).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoMFV r356143:
cy [Tue, 31 Dec 2019 15:50:41 +0000 (15:50 +0000)]
MFV r356143:

Update unbound 1.9.2 --> 1.9.6.

MFC after: 3 days
Security: CVE-2019-18934 (fixed by 1.9.5)

4 years agoAdd flags for upcoming patches related to improved ECN handling.
tuexen [Tue, 31 Dec 2019 14:32:48 +0000 (14:32 +0000)]
Add flags for upcoming patches related to improved ECN handling.
No functional change.
Submitted by: Richard Scheffenegger
Reviewed by: rgrimes@, tuexen@
Differential Revision: https://reviews.freebsd.org/D22429

4 years agoClear the flag indicating that the last received packet was marked CE also
tuexen [Tue, 31 Dec 2019 14:23:52 +0000 (14:23 +0000)]
Clear the flag indicating that the last received packet was marked CE also
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

4 years agopsm: properly check for atkbdc_open failure
kevans [Tue, 31 Dec 2019 13:56:48 +0000 (13:56 +0000)]
psm: properly check for atkbdc_open failure

atkbdc_open can return NULL if the unit's out of bounds or the softc isn't
setup. Check it to be safe.

4 years agoAdd curly braces missed in https://svnweb.freebsd.org/changeset/base/354773
tuexen [Tue, 31 Dec 2019 12:29:01 +0000 (12:29 +0000)]
Add curly braces missed in https://svnweb.freebsd.org/changeset/base/354773

Sponsored by: Netflix, Inc.
CID: 1407649

4 years agoriscv: Remove unused variable
kp [Tue, 31 Dec 2019 11:45:19 +0000 (11:45 +0000)]
riscv: Remove unused variable

Fix the build that was broken by r356221. Pointy hat to myself.

4 years agosifive: uart driver
kp [Tue, 31 Dec 2019 10:54:13 +0000 (10:54 +0000)]
sifive: uart driver

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

4 years agoriscv: Remove pointless loop
kp [Tue, 31 Dec 2019 10:53:03 +0000 (10:53 +0000)]
riscv: Remove pointless loop

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

4 years agortld(1): Do booleans like C99
cem [Tue, 31 Dec 2019 05:41:47 +0000 (05:41 +0000)]
rtld(1): Do booleans like C99

Reviewed by: kib, rlibby
Differential Revision: https://reviews.freebsd.org/D22964

4 years agoSwitch r356210 to use gone_in() instead of printf().
rmacklem [Tue, 31 Dec 2019 05:39:27 +0000 (05:39 +0000)]
Switch r356210 to use gone_in() instead of printf().

Suggested by: cem

4 years agoinetd: prefer strlcpy to strlen(3) check + strcpy(3), NFC
kevans [Tue, 31 Dec 2019 04:53:50 +0000 (04:53 +0000)]
inetd: prefer strlcpy to strlen(3) check + strcpy(3), NFC

This is again functionally equivalent but more concise.

4 years agoinetd: prefer strtonum(3) to strspn(3)+atoi(3), NFC
kevans [Tue, 31 Dec 2019 04:36:14 +0000 (04:36 +0000)]
inetd: prefer strtonum(3) to strspn(3)+atoi(3), NFC

strtonum(3) does effectively the same validation as we had, but it's more
concise.

4 years agoDon't spin on cleanup_lock if we are not interrupt.
mav [Tue, 31 Dec 2019 04:16:52 +0000 (04:16 +0000)]
Don't spin on cleanup_lock if we are not interrupt.

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.

4 years agoinetd: knock out some clang analyze warnings
kevans [Tue, 31 Dec 2019 04:00:24 +0000 (04:00 +0000)]
inetd: knock out some clang analyze warnings

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.

4 years agoAvoid few memory accesses in g_disk_done().
mav [Tue, 31 Dec 2019 03:43:13 +0000 (03:43 +0000)]
Avoid few memory accesses in g_disk_done().

4 years agoReplace .h files included from old NFS directories with the new NFS ones.
rmacklem [Tue, 31 Dec 2019 00:07:10 +0000 (00:07 +0000)]
Replace .h files included from old NFS directories with the new NFS ones.

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.

4 years agoMFV r356163,r356197:
mm [Tue, 31 Dec 2019 00:05:06 +0000 (00:05 +0000)]
MFV r356163,r356197:
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

4 years agoSet a "kernbase" symbol in 32-bit arm locore.S and use it with ldscript.arm.
ian [Mon, 30 Dec 2019 23:20:46 +0000 (23:20 +0000)]
Set a "kernbase" symbol in 32-bit arm locore.S and use it with ldscript.arm.

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).

4 years agoAdd warning printf w.r.t. removal of sys/nfs/nfs_lock.c.
rmacklem [Mon, 30 Dec 2019 22:39:29 +0000 (22:39 +0000)]
Add warning printf w.r.t. removal of sys/nfs/nfs_lock.c.

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.

4 years agoFormatting fixes for tables, no content changes.
jhb [Mon, 30 Dec 2019 22:05:57 +0000 (22:05 +0000)]
Formatting fixes for tables, no content changes.

- 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.

4 years agosh: Test that executing various binary files is rejected
jilles [Mon, 30 Dec 2019 21:32:55 +0000 (21:32 +0000)]
sh: Test that executing various binary files is rejected

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

4 years agoDetermine whether the MMU hardware is capable of updating a page table
alc [Mon, 30 Dec 2019 20:30:31 +0000 (20:30 +0000)]
Determine whether the MMU hardware is capable of updating a page table
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

4 years agolinux(4): implement copy_file_range(2)
kaktus [Mon, 30 Dec 2019 18:11:06 +0000 (18:11 +0000)]
linux(4): implement copy_file_range(2)

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

4 years agoDon't hard-code field offsets of struct riscv_bootparams.
br [Mon, 30 Dec 2019 17:18:50 +0000 (17:18 +0000)]
Don't hard-code field offsets of struct riscv_bootparams.

Submitted by: James Clarke <jrtc27@jrtc27.com>
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22970

4 years agoinetd: don't leak `policy` on return
kevans [Mon, 30 Dec 2019 15:54:36 +0000 (15:54 +0000)]
inetd: don't leak `policy` on return

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

4 years agoDon't hard-code size of struct riscv_bootparams.
br [Mon, 30 Dec 2019 14:38:06 +0000 (14:38 +0000)]
Don't hard-code size of struct riscv_bootparams.

Submitted by: James Clarke <jrtc27@jrtc27.com>
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22968

4 years agoRound the kernel stack allocation up as required.
br [Mon, 30 Dec 2019 13:29:30 +0000 (13:29 +0000)]
Round the kernel stack allocation up as required.

Submitted by: James Clarke <jrtc27@jrtc27.com>
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22961

4 years agoFix spelling.
hselasky [Mon, 30 Dec 2019 09:22:52 +0000 (09:22 +0000)]
Fix spelling.

PR: 242891
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUse atomic for start_count in devstat_start_transaction().
mav [Mon, 30 Dec 2019 03:13:38 +0000 (03:13 +0000)]
Use atomic for start_count in devstat_start_transaction().

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.

4 years ago[PowerPC] Fix panic when attempting to handle an HMI from an idle thread
bdragon [Mon, 30 Dec 2019 02:56:47 +0000 (02:56 +0000)]
[PowerPC] Fix panic when attempting to handle an HMI from an idle thread

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

4 years agosc(4) md bits: stop setting sc->kbd entirely
kevans [Mon, 30 Dec 2019 02:07:55 +0000 (02:07 +0000)]
sc(4) md bits: stop setting sc->kbd entirely

The machdep parts no longer need to touch keyboard parts after r356043;
sc->kbd will be 0-initialized and this works as expected.

4 years agovirtio_random(4): Drop no longer needed unload kludge
cem [Mon, 30 Dec 2019 01:40:59 +0000 (01:40 +0000)]
virtio_random(4): Drop no longer needed unload kludge

After r356194, source deregistration no longer races with concurrent use.

Reviewed by: bryanv, markm
Differential Revision: https://reviews.freebsd.org/D22490

4 years agorandom(4): Make entropy source deregistration safe
cem [Mon, 30 Dec 2019 01:38:19 +0000 (01:38 +0000)]
random(4): Make entropy source deregistration safe

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

4 years agoRetire nstart/nend counters.
mav [Mon, 30 Dec 2019 00:46:10 +0000 (00:46 +0000)]
Retire nstart/nend counters.

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.

4 years agoAdd libdtrace support for arm64 USDT probes.
markj [Sun, 29 Dec 2019 21:46:50 +0000 (21:46 +0000)]
Add libdtrace support for arm64 USDT probes.

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

4 years agoAdd ARMv8 static relocation types used for control flow instructions.
markj [Sun, 29 Dec 2019 21:46:00 +0000 (21:46 +0000)]
Add ARMv8 static relocation types used for control flow instructions.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoRemove GEOM_SCHED class and gsched tool.
mav [Sun, 29 Dec 2019 21:16:03 +0000 (21:16 +0000)]
Remove GEOM_SCHED class and gsched tool.

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

4 years agopowerd(8): Fix a memory leak when we fail to read frequency levels.
markj [Sun, 29 Dec 2019 20:57:49 +0000 (20:57 +0000)]
powerd(8): Fix a memory leak when we fail to read frequency levels.

PR: 242967
Submitted by: Hans Christian Woithe <chwoithe@yahoo.com>
MFC after: 3 days

4 years agoRestore a vm_page_wired() check in vm_page_mvqueue() after r356156.
markj [Sun, 29 Dec 2019 20:01:03 +0000 (20:01 +0000)]
Restore a vm_page_wired() check in vm_page_mvqueue() after r356156.

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>

4 years agoMissed part of r356162.
mav [Sun, 29 Dec 2019 19:33:41 +0000 (19:33 +0000)]
Missed part of r356162.

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.

4 years agoFix GEOM_VIRSTOR orphanization.
mav [Sun, 29 Dec 2019 19:21:29 +0000 (19:21 +0000)]
Fix GEOM_VIRSTOR orphanization.

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.

4 years agoEliminate the generated ldscript for arm and arm64, and strip $a/$d marker
ian [Sun, 29 Dec 2019 18:17:12 +0000 (18:17 +0000)]
Eliminate the generated ldscript for arm and arm64, and strip $a/$d marker
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.

4 years agosysctlbyname(2): Remove temporary compatibility layer
kaktus [Sun, 29 Dec 2019 17:19:57 +0000 (17:19 +0000)]
sysctlbyname(2): Remove temporary compatibility layer

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

4 years agoFix GEOM_MOUNTVER orphanization.
mav [Sun, 29 Dec 2019 17:10:21 +0000 (17:10 +0000)]
Fix GEOM_MOUNTVER orphanization.

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.

4 years agoImplement Linux syslog(2) syscall; just enough to make Linux dmesg(8)
trasz [Sun, 29 Dec 2019 15:53:55 +0000 (15:53 +0000)]
Implement Linux syslog(2) syscall; just enough to make Linux dmesg(8)
utility work.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22465

4 years agognop: change the "count until fail" option
oshogbo [Sun, 29 Dec 2019 15:47:37 +0000 (15:47 +0000)]
gnop: change the "count until fail" option

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

4 years agoMake linprocfs(5) provide an empty /proc/modules. This should silence
trasz [Sun, 29 Dec 2019 15:46:59 +0000 (15:46 +0000)]
Make linprocfs(5) provide an empty /proc/modules.  This should silence
some warnings.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agognop: allow to change the name of created device
oshogbo [Sun, 29 Dec 2019 15:40:02 +0000 (15:40 +0000)]
gnop: allow to change the name of created device

Thanks to this option we can create more then one gnop provider from
single provider. This may be useful for temporary labeling some data
on the disk.

Reviewed by: markj, allanjude, bcr
Differential Revision: https://reviews.freebsd.org/D22304

4 years agoClear queue op flags in vm_page_mvqueue().
markj [Sun, 29 Dec 2019 15:39:43 +0000 (15:39 +0000)]
Clear queue op flags in vm_page_mvqueue().

This fixes a regression in r356155, introduced at the last minute.  In
particular, we must clear PGA_REQUEUE_HEAD before inserting into any
queue besides PQ_INACTIVE since that operation is implemented only for
PQ_INACTIVE.

Reported by: pho, Jenkins via lwhsu

4 years agoMake Linux stat(2) et al distinguish between block and character
trasz [Sun, 29 Dec 2019 13:54:02 +0000 (13:54 +0000)]
Make Linux stat(2) et al distinguish between block and character
devices.  It's required for LTP, among other things.  It's not
complete, but good enough for now.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D22950

4 years agoMove type casts into a single place. No functional changes.
trasz [Sun, 29 Dec 2019 12:24:41 +0000 (12:24 +0000)]
Move type casts into a single place.  No functional changes.

MFC after: 2 weeks

4 years agoImplement Linux BLKGETSIZE64 ioctl.
trasz [Sun, 29 Dec 2019 12:22:11 +0000 (12:22 +0000)]
Implement Linux BLKGETSIZE64 ioctl.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoMake this compile under external gcc toolchain if WITH_ICONV isn't defined.
adrian [Sun, 29 Dec 2019 06:59:09 +0000 (06:59 +0000)]
Make this compile under external gcc toolchain if WITH_ICONV isn't defined.

This quietens a bunch of unused variable warnings that are treated as errors.

4 years agoCorrectly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel
alc [Sun, 29 Dec 2019 05:36:01 +0000 (05:36 +0000)]
Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel
mappings.

Reduce code duplication by defining a function, pmap_abort_ptp(), for
handling a common error case.

Simplify error handling in pmap_enter_quick_locked().

Reviewed by: kib
Tested by: pho
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D22890

4 years agofuspi: Fix 'sleepable after non-sleepable' lock
philip [Sun, 29 Dec 2019 04:26:10 +0000 (04:26 +0000)]
fuspi: Fix 'sleepable after non-sleepable' lock

With WITNESS enabled we see the following warning:

    lock order reversal: (sleepable after non-sleepable)
     1st 0xffffffd0847c7210 fu540spi0 (fu540spi0) @
     /usr/home/kp/axiado/hornet-freebsd/src/sys/riscv/sifive/fu540_spi.c:297
      2nd 0xffffffc00372bb30 Clock topology lock (Clock topology lock) @
      /usr/home/kp/axiado/hornet-freebsd/src/sys/dev/extres/clk/clk.c:1137
      stack backtrace:
      #0 0xffffffc0002a579e at witness_checkorder+0xb72
      #1 0xffffffc0002a5556 at witness_checkorder+0x92a
      #2 0xffffffc000254c7a at _sx_slock_int+0x66
      #3 0xffffffc00025537a at _sx_slock+0x8
      #4 0xffffffc000123022 at clk_get_freq+0x38
      #5 0xffffffc0005463e4 at __clzdi2+0x2bb8
      #6 0xffffffc00014af58 at randomdev_getkey+0x76e
      #7 0xffffffc0001278b0 at simplebus_add_device+0x7ee
      #8 0xffffffc00027c9a8 at device_attach+0x2e6
      #9 0xffffffc00027c634 at device_probe_and_attach+0x7a
      #10 0xffffffc00027d76a at bus_generic_attach+0x10
      #11 0xffffffc00014aab0 at randomdev_getkey+0x2c6
      #12 0xffffffc00027c9a8 at device_attach+0x2e6
      #13 0xffffffc00027c634 at device_probe_and_attach+0x7a
      #14 0xffffffc00027d76a at bus_generic_attach+0x10
      #15 0xffffffc000278bd2 at config_intrhook_oneshot+0x52
      #16 0xffffffc000278b3e at config_intrhook_establish+0x146
      #17 0xffffffc000278cf2 at config_intrhook_disestablish+0xfe

The clock topology lock can sleep, which means we cannot attempt to
acquire it while holding the non-sleepable mutex.

Fix that by retrieving the clock speed once, during attach and not every
time during SPI transaction setup.

Submitted by:   kp
Sponsored by:   Axiado

4 years agoRegenerate src.conf(5) after r356164
kevans [Sun, 29 Dec 2019 02:12:18 +0000 (02:12 +0000)]
Regenerate src.conf(5) after r356164

4 years agoChange reference in HTTPD descriptions to 'simple_httpd'
kevans [Sun, 29 Dec 2019 02:11:58 +0000 (02:11 +0000)]
Change reference in HTTPD descriptions to 'simple_httpd'

This should help people examining src.conf(5) draw the connection between
the HTTPD knobs and the particular implementation we're installing,
simple_httpd.

Reported by: saken658 via GitHub

4 years agoUpdate vendor/libarchive/dist to git 1dae5a549fe4ab99fd3a49a9edcf897a7b2b1844
mm [Sat, 28 Dec 2019 23:40:32 +0000 (23:40 +0000)]
Update vendor/libarchive/dist to git 1dae5a549fe4ab99fd3a49a9edcf897a7b2b1844

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)

4 years agoFix GEOM_SHSEC orphanization.
mav [Sat, 28 Dec 2019 23:21:53 +0000 (23:21 +0000)]
Fix GEOM_SHSEC orphanization.

Previous code closed and destroyed consumer even with I/O in progress.
This patch postpones the destruction till the last close, identical to
GEOM_STRIPE, since they seem to have common origin.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoRemove some unused functions.
markj [Sat, 28 Dec 2019 19:04:29 +0000 (19:04 +0000)]
Remove some unused functions.

The previous series of patches orphaned some vm_page functions, so
remove them.

Reviewed by: dougm, kib
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D22886

4 years agoUpdate the vm_page.h block comment to reflect recent changes.
markj [Sat, 28 Dec 2019 19:04:15 +0000 (19:04 +0000)]
Update the vm_page.h block comment to reflect recent changes.

Explain the new locking rules for per-page queue state updates.

Reviewed by: jeff, kib
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D22884