r339677 kevans Oct. 24, 2018, 2:02 a.m.
In the majority of cases, a kernel is not loaded before we hit the menu.
However, if a password is set, we'll trigger autoboot and have loadelf'd
beforehand. We also need to take into account one dropping to the loader
prompt and twiddling with things manually; if they try to toggle through
kernels, we'll assume they mean it.

Reported by:	trasz
MFC after:	 3 days
r339676 kp Oct. 24, 2018, 12:19 a.m.
We checked the destination address, but replaced the source address. This was
fixed in OpenBSD as part of their NAT rework, which we don't want to import
right now.

CID:		1009561
MFC after:	3 weeks
r339675 markj Oct. 24, 2018, 12:17 a.m.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
r339674 kp Oct. 23, 2018, 11:15 p.m.
There's no point in the NULL check for ifp, because we'll already have
dereferenced it by then. Moreover, the event will always have a valid ifp.

Replace the late check with an early assertion.

CID:		1357338
r339673 kib Oct. 23, 2018, 11:11 p.m.
ffs_subr.c requires calculate_crc32c() from libkern.  Unfortunately we
cannot just add libkern/crc32.c to libstand because crc32.o is already
compiled from contrib/zlib/crc32.c. Use the include trick to rename
the source.

Note that libstand also provides crc32.c which seems to be unused.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D17677
r339672 kib Oct. 23, 2018, 9:43 p.m.
Use bypass to catch any NFS VOP dispatch and route it through the
wrapper which does sigdeferstop() and then dispatches original
VOP. NFS does not need a bypass below it, which is not supported.

The vop offset in the vop_vector is added since otherwise it is
impossible to get vop_op_t from the internal table, and I did not
wanted to create the layered fs only to wrap NFS VOPs.

VFS_OP()s wrap is straightforward.

Requested and reviewed by:	mjg (previous version)
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D17658
r339671 mckusick Oct. 23, 2018, 9:10 p.m.
check hash to the superblock. If a check hash fails when an attempt
is made to mount a filesystem, the mount fails with EINVAL (Invalid
argument). This avoids a class of filesystem panics related to
corrupted superblocks. The hash is done using crc32c.

Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily
used in embedded systems with small memories and low-powered processors
which need as light-weight a filesystem as possible.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix
r339668 imp Oct. 23, 2018, 8:45 p.m.
some ports can be updated.
r339667 np Oct. 23, 2018, 6:32 p.m.
Submitted By: Lily Wang @ Netapp

MFC after:	1 week
r339666 jhb Oct. 23, 2018, 6:31 p.m.
MFC after:	2 months
Sponsored by:	Chelsio Communications
r339665 jhb Oct. 23, 2018, 6:07 p.m.
MFC after:	2 months
Sponsored by:	Chelsio Communications
r339664 markj Oct. 23, 2018, 6:07 p.m.
Reported by:	yuripv
X-MFC with:	r339452
Sponsored by:	The FreeBSD Foundation
r339663 kib Oct. 23, 2018, 5:53 p.m.
Several code paths might result in returning uninitialized value.

Reported by:	coverity through cem
CID:	1396315
Sponsored by:	The FreeBSD Foundation
r339662 erj Oct. 23, 2018, 5:06 p.m.
That commit is causing kernel panics in em(4), so this will be reverted
until those are fixed.

Reported by:	ae@, pho@, et al
Sponsored by:	Intel Corporation
r339661 markj Oct. 23, 2018, 4:35 p.m.
Before this change we had two flavours of vm_domainset iterators: "page"
and "malloc".  The latter was only used for kmem_*() and hard-coded its
behaviour based on kernel_object's policy.  Moreover, its use contained
a race similar to that fixed by r338755 since the kernel_object's
iterator was being run without the object lock.

In some cases it is useful to be able to explicitly specify a policy
(domainset) or policy+iterator (domainset_ref) when performing memory
allocations.  To that end, refactor the vm_dominset_* KPI to permit
this, and get rid of the "malloc" domainset_iter KPI in the process.

Reviewed by:	jeff (previous version)
Tested by:	pho (part of a larger patch)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17417