Commit Graph

235039 Commits

Author SHA1 Message Date
Andrew Turner
cd2106eaea Ensure the DPCPU and VNET module spaces are aligned to hold a pointer.
Previously they may have been aligned to a char, leading to misaligned
DPCPU and VNET variables.

Sponsored by:	DARPA, AFRL
2018-07-30 14:25:17 +00:00
David Bright
d0a179019f Correct possible misleading error message in kqtest.
ian@ pointed out that in the test_abstime() function time(NULL) is
used twice; once in an "if" test and again in the enclosed error
message. If the true branch was taken and the process got preempted
before the second time(NULL) call, by the time the error message was
generated enough time could have elapsed that the message could claim
that the event came "too early" but print an event time that was after
the expected timeout. Correct by making the time(NULL) call only once
and using that returned time in both the "if" test and the error
message.

Reported by:	ian@
MFC after:	4 days
X-MFC-with:	r336761, r336781, r336802
Sponsored by:	Dell EMC
2018-07-30 14:21:49 +00:00
Ed Maste
0f17b0b587 Regen src.conf.5 after r336901, WITH_LLD_BOOTSTRAP on i386
Sponsored by:	The FreeBSD Foundation
2018-07-30 12:58:33 +00:00
Andrew Turner
bc61d94997 As with DPCPU_DEFINE make it a compile error to use static with VNET_DEFINE.
There is the VNET_DEFINE_STATIC macro for that.
2018-07-30 12:44:44 +00:00
Ed Maste
f1a0604de4 Enable ld.lld as bootstrap linker by default on i386
Akin to r327783 for amd64.  lld has been usable for amd64 for quite some
time, but a couple of issues remained that affected i386.  These were
recently addressed upstream in lld and merged into FreeBSD or addressed
directly in FreeBSD (r326831, r326879, r326897, r326957, r333401,
r334626, r336664).

Similarly to the intial amd64 commit this change enables lld only as the
bootstrap linker (used to link the kernel and userland libraries and
executables), while GNU ld.bfd is still installed as /usr/bin/ld and
used for ports builds.  That will be changed shortly, after an exp-run.

This is a recommit of r327823 after additional lld fixes.

PR:		225128 (exp-run)
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2018-07-30 12:38:08 +00:00
Ruslan Bukin
a304bc9729 Disable VIMAGE on RISC-V.
Similar to r326179 ("Temporarily disable VIMAGE on arm64") creation of
if_lagg or epair on RISC-V results a kernel panic.

Sponsored by:	DARPA, AFRL
2018-07-30 12:22:49 +00:00
Roger Pau Monné
5477025a10 xen/grants: fix deadlocks in the free callbacks
This fixes the panic caused by deadlocking when grant-table free
callbacks are used.

The cause of the recursion is: check_free_callbacks() is always called
with the lock gnttab_list_lock held. In turn the callback function is
also called with the lock held. Then when the client uses any of the grant
reference methods which also attempt the lock the gnttab_list_lock
mutex from within the free callback a deadlock happens.

Fix this by making the gnttab_list_lock recursive.

Submitted by:		Pratyush Yadav <pratyush@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D16505
2018-07-30 11:41:51 +00:00
Roger Pau Monné
83c2fa73e6 xen-blkfront: fix memory leak in xbd_connect error path
If gnttab_grant_foreign_access() fails for any of the indirection
pages, the code breaks out of both the loops without freeing the local
variable indirectpages, causing a memory leak.

Submitted by:		Pratyush Yadav <pratyush@freebsd.org>
Differential Review:	https://reviews.freebsd.org/D16136
2018-07-30 11:27:51 +00:00
Roger Pau Monné
8b19549b0e xen-blkfront: fix length check
Length is an unsigned integer, so checking against < 0 doesn't make
sense. While there also make clear that a length of 0 always succeeds.

Submitted by:		Pratyush Yadav <pratyush@freebsd.org>
Differential Review:	https://reviews.freebsd.org/D16045
2018-07-30 11:15:20 +00:00
Andrew Turner
011dc75d9c Remove teh non-INTRNG code from the ARM GIC interrupt controller driver.
We don't build for the non-INTRNG case and it was makeing the code harder
to read.
2018-07-30 10:55:02 +00:00
Randall Stewart
4ad5b7a0ac This fixes a hole where rack could end up
sending an invalid segment into the reassembly
queue. This would happen if you enabled the
data after close option.

Sponsored by:	Netflix
Differential Revision: https://reviews.freebsd.org/D16453
2018-07-30 10:23:29 +00:00
Andrew Turner
3810edcf6b Require ARMv5 for arm. All current kernels are for ARMv5 or later, and it
will allow us to clean out old ARMv4 (and earlier) specific assembly.

Relnotes:	yes
2018-07-30 09:50:26 +00:00
David E. O'Brien
455d358977 Correct copyright dates. 2018-07-30 07:01:00 +00:00
Alan Cox
cd914c2fc2 Prepare for adding psind == 1 support to armv6's pmap_enter().
Precompute the new PTE before entering the critical section.

Eliminate duplication of the pmap and pv list unlock operations in
pmap_enter() by implementing a single return path.  Otherwise, the
duplication will only increase with the upcoming support for psind == 1.

Reviewed by:	mmel
Tested by:	mmel
Discussed with:	kib, markj
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D16443
2018-07-30 01:54:25 +00:00
Ed Maste
5f9d7aafd8 Correct typo and whitespace in UPDATING
PR:		230124
Submitted by:	Samy Mahmoudi
2018-07-30 00:04:42 +00:00
Rick Macklem
8014c97147 Silence newer gcc warnings.
Newer versions of gcc generate "set, but not used" warnings in the NFS server.
Add __unused macros to silence these warnings.

Requested by:	mmacy
2018-07-29 21:51:17 +00:00
Eitan Adler
27744ca71c Revert "devd: use C++ style casts"
It seems that nullptr is not yet supported by all compilers used by
FreeBSD. :(
2018-07-29 21:00:18 +00:00
Konstantin Belousov
b3a7db3b06 Use SMAP on amd64.
Ifuncs selectors dispatch copyin(9) family to the suitable variant, to
set rflags.AC around userspace access.  Rflags.AC bit is cleared in
all kernel entry points unconditionally even on machines not
supporting SMAP.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D13838
2018-07-29 20:47:00 +00:00
Alan Somers
70eaeb3622 audit(4): add tests for sysctl(3) and sysarch(2)
Submitted by:	aniketp
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D16116
2018-07-29 20:34:44 +00:00
Alan Somers
9dea3ac8c2 freebsd32_getrusage(2): skip freebsd32_rusage_out on error
PR:		230153
Reported by:	kib
MFC after:	2 weeks
X-MFC-With:	336871
Differential Revision:	https://reviews.freebsd.org/D16500
2018-07-29 19:20:13 +00:00
Alan Somers
5cf35a100c getrusage(2): fix return value under 32-bit emulation
According to the man page, getrusage(2) should return EFAULT if the rusage
argument lies outside of the process's address space. But due to an
oversight in r100384, that's never been the case during 32-bit emulation.
Fix it.

PR:		230153
Reported by:	tests(7)
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16500
2018-07-29 18:22:26 +00:00
Ian Lepore
6dfd050075 The device ID tables are used only within the driver, make them static so
that both of these drivers can exist in the same kernel.
2018-07-29 16:55:28 +00:00
Antoine Brodin
ccd6ac9f6e Add allow.mlock to jail parameters
It allows locking or unlocking physical pages in memory within a jail

This allows running elasticsearch with "bootstrap.memory_lock" inside a jail

Reviewed by:	jamie@
Differential Revision:	https://reviews.freebsd.org/D16342
2018-07-29 12:41:56 +00:00
Eitan Adler
fc67c746c0 devd: use C++ style casts 2018-07-29 08:43:08 +00:00
Eitan Adler
514e2dbfa6 devd: use static where possible 2018-07-29 08:43:05 +00:00
Eitan Adler
ec9eb99714 truncate: delintify 2018-07-29 07:51:42 +00:00
Eitan Adler
c517ae76c1 truncate: use better type for 'round' 2018-07-29 07:51:40 +00:00
Don Lewis
c13b53f6fb Fix a variable name typo in r336845 that prevented the rc.d scripts
from being installed in the correct directory.

Resurrect a few rc.d scripts that were prematurely deleted from the
Makefile by r336845.

Reviewed by:	brd
2018-07-29 05:42:07 +00:00
Brad Davis
d2b68ebeaf Fix a typo that prevented some rc scripts from being installed.
Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16495
2018-07-29 03:20:05 +00:00
Will Andrews
16702050ac beinstall: perform pre-installworld steps.
Since all post-installkernel steps are assumed to operate in the updated
installation, it's necessary to chroot all of the followup steps in the new
boot environment.  Set up and mount the source and object directories at the
same paths inside the BE root, and clean up to the extent changes were made.
This commit fixes upgrading using beinstall past the new ntpd user change.

Improve testability of changes to this script while I'm here.

Reported by:	rpokala (earlier patch)
2018-07-29 01:44:26 +00:00
Don Lewis
290d906084 Fix the long term ULE load balancer so that it actually works. The
initial call to sched_balance() during startup is meant to initialize
balance_ticks, but does not actually do that since smp_started is
still zero at that time.  Since balance_ticks does not get set,
there are no further calls to sched_balance().  Fix this by setting
balance_ticks in sched_initticks() since we know the value of
balance_interval at that time, and eliminate the useless startup
call to sched_balance().  We don't need to randomize the intial
value of balance_ticks.

Since there is now only one call to sched_balance(), we can hoist
the tests at the top of this function out to the caller and avoid
the overhead of the function call when running a SMP kernel on UP
hardware.

PR:		223914
Reviewed by:	kib
MFC after:	2 weeks
2018-07-29 00:30:06 +00:00
Martin Matuska
f1951fd745 MFV r336851:
Update vendor/libarchive/dist to git 2c8c83b9731ff822fad6cc8c670ea5519c366a14

Important vendor changes:
  PR #993: Chdir to -C directory for metalog processing
  OSS-Fuzz #4969: Check size of the extended time field in zip archives
  PR #973: Record informational compression level in gzip header

MFC after:	1 week
2018-07-29 00:12:16 +00:00
Conrad Meyer
522867c218 wpa_supplicant.8: Remove removed option
Our base version of wpa_supplicant does not support the -u option, so remove
it.

PR:		230102
Submitted by:	D Green <dfrg AT xsmail.com>
2018-07-28 23:59:36 +00:00
Conrad Meyer
337bd62722 exec.3: Add BUGS section and document non-FreeBSD portability
Requested by:	kib (in part)
2018-07-28 23:55:18 +00:00
Martin Matuska
0b7a6fc00b Update vendor/libarchive/dist to git 2c8c83b9731ff822fad6cc8c670ea5519c366a14
Important vendor changes:
  PR #993: Chdir to -C directory for metalog processing
  OSS-Fuzz #4969: Check size of the extended time field in zip archives
  PR #973: Record informational compression level in gzip header
2018-07-28 23:47:22 +00:00
Brad Davis
4f1521406b Move nscd.conf from etc/ to usr.sbin/nscd/
Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16490
2018-07-28 23:29:36 +00:00
Brad Davis
76ec4952ff Switch these to CONFS as well so they work with etcupdate/mergemaster.
Approved by:	will (mentor)
2018-07-28 23:02:10 +00:00
Emmanuel Vadot
4b99ca8e4c release: arm: Add a GENERIC sdcard image
This produce a generic sdcard image using armv7 GENERIC kernel that
just need some u-boot (or none if the board have u-boot or a SPI flash
for example).

Reviewed by:	imp, gjb
Differential Revision:	https://reviews.freebsd.org/D16410
2018-07-28 20:45:36 +00:00
Brad Davis
df89e31712 Opps, I missed moving a couple of files in r336845.
Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16466
2018-07-28 20:41:33 +00:00
Brad Davis
1135e97b7c Move rc startup scripts from etc/ to sbin/init/
This keeps most startup scripts as CONFS per discussion on src-committers from
back during BSDCan.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16466
2018-07-28 20:36:23 +00:00
Emmanuel Vadot
c59a544e09 UPDATING: Add note about efifb support and serial output 2018-07-28 20:33:08 +00:00
Brad Davis
d26b89d9b6 Whitespace only change, no functional change intended.
The padding makes it much easier to read, but occasionally means that commits
like this one have to be done to follow up.  I intentionally kept this
separate from r336841 to try and make things easier to follow later on.

Approved by:	bapt (mentor)
2018-07-28 20:31:03 +00:00
Brad Davis
c696b89541 Fix `make distribute' installing some configs which means CONFS was broken
with etcupdate and mergemaster.

Approved by:	bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D16478
2018-07-28 20:26:25 +00:00
Brad Davis
a0a1ffcb16 Move etc/shells to lib/libc/gen with getusershell(3).
Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16467
2018-07-28 20:21:23 +00:00
Rick Macklem
a3e709cd33 Modify the NFSv4.1 server so that it allows ReclaimComplete as done by ESXi 6.7.
I believe that a ReclaimComplete with rca_one_fs == TRUE is only
to be used after a file system has been transferred to a different
file server.  However, RFC5661 is somewhat vague w.r.t. this and
the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs == TRUE
and one with ReclaimComplete with rca_one_fs == FALSE.
Therefore, just ignore the rca_one_fs == TRUE operation and return
NFS_OK without doing anything instead of replying NFS4ERR_NOTSUPP.
This allows the ESXi 6.7 NFSv4.1 client to do a mount.
After discussion on the NFSv4 IETF working group mailing list, doing this
along with setting a flag to note that a ReclaimComplete with rca_one_fs TRUE
was an appropriate way to handle this.
The flag that indicates that a ReclaimComplete with rca_one_fs == TRUE was
done may be used to disable replies of NFS4ERR_GRACE for non-reclaim
state operations in a future commit.

This patch along with r332790, r334492 and r336357 allow ESXi 6.7 NFSv4.1 mounts
work ok. ESX 6.5 NFSv4.1 mounts do not work well, due to what I believe are
violations of RFC-5661 and should not be used.

Reported by:	andreas.nagy@frequentis.com
Tested by:	andreas.nagy@frequentis.com, daniel@ftml.net (earlier version)
MFC after:	2 weeks
Relnotes:	yes
2018-07-28 20:21:04 +00:00
Alan Somers
80d3469a3f Disable -Wcast-align in libbsm and libauditd
Along with some pending upstream changes, this will allow raising the WARNS
level.

Reviewed by:	cem, aniketp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16486
2018-07-28 20:04:39 +00:00
Warner Losh
e78f6dd79f Be more conservative about setting hw.uart.console
Note when we've found a 8250 PNP node. Only try to set hw.uart.console
if we see one (otherwise ignore serial hints). The 8250 is the only
one known to have I/O ports, so limit the guessing to when we've
positively seen one.  And limit this to x86 since that's the only
platform where we have I/O ports. Otherwise, we'd set the serial port
to something crazy for the platform and fall off the cliff early in
boot.

Differential Revision:  https://reviews.freebsd.org/D16463
2018-07-28 19:44:20 +00:00
Conrad Meyer
858178a142 Remove insecure ciphers from GCE sshd configuration
They were added for unclear reasons in r277263.  The current OpenSSH
defaults (7.5+) are reasonable, and do not include the insecure rc4 cipher:

                   chacha20-poly1305@openssh.com,
                   aes128-ctr,aes192-ctr,aes256-ctr,
                   aes128-gcm@openssh.com,aes256-gcm@openssh.com,
                   aes128-cbc,aes192-cbc,aes256-cbc

I think I recall there being a reason for a specific list of ciphers on GCE
at the time, but I do not recall what it was, and cannot find any
current GCE documentation of such a list.

So, just revert the explicit configuration and use sane openssh defaults.

PR:		230092
Submitted by:	Gustavo Scalet <gustavo.scalet AT collabora.com>
MFC after:	3 days
Security:	yes
2018-07-28 19:35:49 +00:00
Conrad Meyer
bbc5c8ee32 Clean up execl*(3) manual page prototype formatting
Rendering of execle was missing a comma between the NULL argument and envp.

For unclear reasons, POSIX' definition of these routines comments out the
mandatory trailing NULL argument.  That seems unnecessary and probably
(reasonably) confuses mdoc.

For unclear reasons, POSIX' definition of these routines spells NULL as
"(char *)0."  This is needlessly unclear.  One guess might be that POSIX
targets more exotic computer architectures than FreeBSD does.  Fortunately,
there is no such problem on any reasonable platform for FreeBSD to support.
Spell NULL as NULL.

The comma was probably removed in r117204 while the comment and creative
spelling of NULL were added in r116537 (both 15 years ago).
2018-07-28 19:08:00 +00:00
Andrew Turner
cb5ce014d4 Use the cp15 functions to read cp15 registers rather than using assembly
functions. The former are static inline functions so will compile to a
single instruction.
2018-07-28 17:21:34 +00:00