Commit Graph

234197 Commits

Author SHA1 Message Date
Mariusz Zaborski
0dea6e3c98 core(5): overwrite the oldest core dump
The '%I' format in the kern.corefile sysctl limits the number of
core files that a process can generate to the number stored in the
debug.ncores sysctl. The '%I' format is replaced by the single digit
index. Previously, if all indexes were taken the kernel would overwrite
only a core file with the highest index in a filename.
Currently the system will create a new core file if there is a free
index or if all slots are taken it will overwrite the oldest one.

Reviewed by:	kib(code), bcr (updating)
Differential Revision:	https://reviews.freebsd.org/D15991
Differential Revision:	https://reviews.freebsd.org/D16084
2018-07-01 17:28:46 +00:00
Edward Tomasz Napierala
775c9076c7 Add basic examples to portsnap(8).
MFC after:	2 weeks
2018-07-01 16:18:38 +00:00
Alan Somers
b1b5f04d5b audit(4): add tests for procctl(2)
Submitted by:	aniketp
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D16086
2018-07-01 16:05:50 +00:00
Kristof Provost
6dd9dfc449 carp: Minor language improvements in the man page
Submitted by:	Massimiliano Stucchi <max AT stucchi.ch>
2018-07-01 15:17:53 +00:00
Bryan Drewery
eedfb878c9 Ignore _.universe-toolchain file.
MFC after:	3 weeks
X-MFC-with:	r335711
2018-07-01 13:50:37 +00:00
Wolfram Schneider
d0338de5ca `make installworld' should display "completed" message if done
PR:             225159
Reviewed by:    bdrewery
Approved by:    cem (mentor)
Differential Revision:  https://reviews.freebsd.org/D14057
2018-07-01 10:05:45 +00:00
Kristof Provost
0d3d234cd1 carp: Set DSCP value CS7
Update carp to set DSCP value CS7(Network Traffic) in the flowlabel field of
packets by default. Currently carp only sets TOS_LOWDELAY in IPv4 which was
deprecated in 1998. This also implements sysctl that can revert carp back to
it's old behavior if desired.

This will allow implementation of QOS on modern network devices to make sure
carp packets aren't dropped during interface contention.

Submitted by:	Nick Wolff <darkfiberiru AT gmail.com>
Reviewed by:	kp, mav (earlier version)
Differential Revision:	https://reviews.freebsd.org/D14536
2018-07-01 08:37:07 +00:00
Daichi GOTO
4417ed2dbf top(1) - support UTF-8 display
Reviewed by:	eadler
Approved by:	gnn (mentor)
Differential Revision:	https://reviews.freebsd.org/D16006
2018-07-01 05:32:03 +00:00
Will Andrews
24e8c13220 pf(4): remove reference to non-existent pflow(4). 2018-07-01 01:56:40 +00:00
Warner Losh
2fd8cef47f Mention, belatedly, the need to run mergemaster. This somehow
wasn't committed with the other changes.
2018-07-01 01:45:41 +00:00
Will Andrews
c1887e9f09 pf: remove unused ioctls.
Several ioctls are unused in pf, in the sense that no base utility
references them.  Additionally, a cursory review of pf-based ports
indicates they're not used elsewhere either.  Some of them have been
unused since the original import.  As far as I can tell, they're also
unused in OpenBSD.  Finally, removing this code removes the need for
future pf work to take them into account.

Reviewed by:		kp
Differential Revision:	https://reviews.freebsd.org/D16076
2018-07-01 01:16:03 +00:00
Will Andrews
e0ddf97a63 Rather belatedly add myself to committers-src.dot. 2018-07-01 01:11:32 +00:00
Will Andrews
7d4a3185c9 beinstall: enable use with git worktrees. 2018-07-01 01:09:52 +00:00
Matt Macy
f25b23cf89 in6_pcblookup_hash: validate inp for liveness 2018-07-01 01:01:59 +00:00
Bryan Drewery
2e90942fa6 META_MODE: Fix clang-tblgen flip-flop building after r335707.
The build of this would have MK_LLVM_TARGET_ALL=yes for bootstrap-tools
but MK_LLVM_TARGET_ALL=no for cross-tools and thus would rebuild between
the two.

MFC after:	2 weeks
X-MFC-with:	r335707
Sponsored by:	Dell EMC
2018-06-30 19:36:02 +00:00
Maxim Konovalov
391f09e122 ascii art fixed. 2018-06-30 18:18:41 +00:00
Dimitry Andric
55458465af More follow-up to r335799 (llvm/clang 6.0.1 update), where I forgot to
update mtree files, ObsoleteFiles and a number of other paths.  Sorry
about all the breakage.

Pointy hat to:	me
MFC after:	2 weeks
X-MFC-With:	r335799
2018-06-30 15:03:22 +00:00
Kristof Provost
de210decd1 pfsync: Fix state sync during initial bulk update
States learned via pfsync from a peer with the same ruleset checksum were not
getting assigned to rules like they should because pfsync_in_upd() wasn't
passing the PFSYNC_SI_CKSUM flag along to pfsync_state_import.

PR:		229092
Submitted by:	Kajetan Staszkiewicz <vegeta tuxpowered.net>
Obtained from:	OpenBSD
MFC after:	1 week
Sponsored by:	InnoGames GmbH
2018-06-30 12:51:08 +00:00
Rick Macklem
2f800e5593 Add a safety belt assignment to the nfsd for when "-p" isn't specified.
The kernel code assumes that nfsdargs.addr == NULL and nfsdargs.addrlen == 0
when there is no "-p" argument used for starting the nfsd.
This small patch ensures this is the case. In practice, I believe this always
happened, since "nfsdargs" was the last element on the stack for "main()",
but this little patch ensures it will be the case.
Spotted by inspection while adding a new optional field for "-p".
2018-06-30 12:14:20 +00:00
Dimitry Andric
fbfca78ed2 Follow-up to r335799 (llvm/clang 6.0.1 update), by regenerating various
headers with new version information defines.

MFC after:	2 weeks
X-MFC-With:	r335799
2018-06-30 10:04:44 +00:00
Eitan Adler
fd3150d8bf iwn: Add the missing IWN_SDID_6035_5 subdevice
Obtained from:	Haiku (da166fc6469b98397de98a7ccc13b82a3cd3b290)
2018-06-30 04:30:08 +00:00
Eitan Adler
b2c6bc79bb bsd-family-tree: Announce DragonFly version 5.2.2
Obtained from:	https://www.dragonflybsd.org/release52/
2018-06-30 01:04:37 +00:00
Eitan Adler
6e5e6c444d bsd-family-tree: Announce DragonFly version 5.2.2
Obtained from:	https://www.dragonflybsd.org/release52/
2018-06-30 01:02:59 +00:00
Jung-uk Kim
da9b0901f6 MFV: r335802
Merge ACPICA 20180629.
2018-06-29 23:48:30 +00:00
Kirk McKusick
ab0bcb6032 Create um_flags in the ufsmount structure to hold flags for a UFS filesystem.
Convert integer structure flags to use um_flags:

	int	um_candelete;			/* devvp supports TRIM */
	int	um_writesuspended;		/* suspension in progress */

become:

#define UM_CANDELETE		0x00000001	/* devvp supports TRIM */
#define UM_WRITESUSPENDED	0x00000002	/* suspension in progress */

This is in preparation for adding other flags to indicate forcible
unmount in progress after a disk failure and possibly forcible
downgrade to read-only.

No functional change intended.

Sponsored by:	Netflix
2018-06-29 22:24:41 +00:00
Alex Richardson
55a5b46aff Don't change directory owner to root when building with -DNO_ROOT
Currently the mtree calls in Makefile.inc1 all change the directory owner
to match the spec file. However, we should not be doing this during
distributeworld if -DNO_ROOT is passed. Additionally, when creating the
WORLDTMP directory hierachy there is no need to change the owner to root so
we now always pass the -W flag when populating WORLDTMP.

This is also required for building FreeBSD on Linux/Mac since the required
groups/users will not exist there which is how I discovered this issue.

Reviewed By:	emaste, bdrewery, imp
Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D14185
2018-06-29 21:15:26 +00:00
Alex Richardson
53ed3b32ae Fix missing files in METALOG with -DNO_ROOT
By using INSTALL_LINK instead of calling ln during install the files
end up in the METALOG file as well if we use -DNO_ROOT and will be
included in a disk image when using makefs with METALOG as the input.
The other file that was not included in METALOG was /var/db/services.db
which is now also included for -DNO_ROOT.

Approved By:	brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D15665
2018-06-29 21:15:17 +00:00
Jung-uk Kim
d776ccceca Import ACPICA 20180629. 2018-06-29 20:16:57 +00:00
Justin Hibbits
341679e1f2 Support multiple OPAL consoles, and don't crash if uart is not stdout
Summary: If the chosen console is not the OPAL uart, but OPAL uart devices
exist, the console device doesn't attach properly, and faults in the interrupt
handler, with a NULL pointer dereference.  To fix this, and as a byproduct, also
support multiple OPAL consoles, refactor to have the console getc callback use
the appropriate softc instead of the global console_sc, which may be NULL in the
case of a different device being the console.

Reviewed by:	nwhitehorn
Differential Revision: https://reviews.freebsd.org/D16071
2018-06-29 19:35:25 +00:00
Ed Maste
030efb3cc6 newvers.sh: avoid possibly invalid relative directory
Previously newvers.sh passed --work-tree=${VCSDIR}/.. when invoking git.
When using git worktree .git is actually a file, not a directory, and
.git/.. is not a valid path.  Although it appears git handles this
internally (perhaps it normalizes the path first), it is simple enough
for the script to store both the working tree top-level directory and
the VCS (.git) directory, so do so.

Sponsored by:	The FreeBSD Foundation
2018-06-29 18:45:29 +00:00
Dimitry Andric
6ccc06f6cb Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.1 release (upstream r335540).

Relnotes:	yes
MFC after:	2 weeks
2018-06-29 17:51:35 +00:00
Brooks Davis
fa8c921e3f Correct link metadata created when installing with -DNO_ROOT.
Explicitly specify owner/group/mode metadata when creating links.

More consistently use INSTALL_SYMLINK to install symlinks.

Reviewed by:	bdrewery
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D11231
2018-06-29 16:07:56 +00:00
Ed Maste
5b2b45a421 r335795 build fix: make static functions static
-Werror,-Wmissing-prototypes makes this an error otherwise.

MFC with:	335795
Sponsored by:	The FreeBSD Foundation
2018-06-29 14:51:36 +00:00
Andrey V. Elsukov
52b3619f45 Make debug output produced by setkey -x command a more human readable.
Add text names of SADB message types and extension headers to the output.

Obtained from:	Yandex LLC
MFC after:	2 weeks
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D16036
2018-06-29 13:59:33 +00:00
Rick Macklem
1aabf3fd5e Fix the pNFS server for a case where mirror level equals number of DSs.
If a pNFS service was set up where the number of DSs equals the mirror level
and then a DS was disabled, the service would create files with duplicate
entries for the same DS. This bug occurred because I didn't realize that
TAILQ_FOREACH_FROM() would start at the beginning of the list when the
inital value of the variable was NULL.
This patch also changes the pNFS server DS file creation code so that it
creates entrie(s) with 0.0.0.0 IP address when it cannot create mirror level
files due to lack of DSs.
The patch only affects the pNFS service and only when it was created with
a number of DSs equal to the mirror level and mirroring is enabled.
2018-06-29 12:41:36 +00:00
Ruslan Bukin
a08232301d Include UART driver since it is now provided in QEMU.
Sponsored by:	DARPA, AFRL
2018-06-29 10:55:42 +00:00
Alan Somers
af045bbfd7 audit(4): add tests for several more administrative syscalls
Includes ntp_adjtime, auditctl, acct, auditon, and clock_settime.  Includes
quotactl, mount, nmount, swapon, and swapoff in failure mode only.  Success
tests for those syscalls will follow.  Also includes reboot(2) in failure
mode only.  That one can't be tested in success mode.

Submitted by:	aniketp
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D15898
2018-06-29 04:52:27 +00:00
Alan Somers
18ba95c24a audit(4): add tests for setsid, wait4, wait6, and kill
Submitted by:	aniketp
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2018)
Differential Revision:	https://reviews.freebsd.org/D16035
2018-06-29 04:46:15 +00:00
Alan Cox
9161b4de54 Three changes to vm_phys_alloc_seg_contig():
1. Optimize the order computation.

2. Update the pool for all of the chunks that are removed from the free
   page lists, and not just the first chunk.

3. Simplify the code for returning excess pages to the free page lists.

Reviewed by:	Doug Moore <dougm@rice.edu>
2018-06-29 04:08:14 +00:00
Bryan Drewery
8706983ff6 Fix unknown target check after r335450.
X-MFC-with:	r335450
Pointyhat to:	bdrewery
Sponsored by:	Dell EMC
2018-06-28 22:24:16 +00:00
Ian Lepore
795c4eaa37 When being verbose about various leapfile versions, also mention expiration.
The expiration date is actually more of a version number than the version
date, because expiration changes twice a year, whereas the version only
changes when actual leap second events occur (except in USNO leapfiles,
which inappropriately bump the version with every expiration date change).
2018-06-28 22:13:32 +00:00
Ian Lepore
b5a278bcf4 Rename variable ntp_tmp_leapfile to have a leading underbar, to distinguish
it from variables with similar names which are set in rc.conf.  This will
make more sense as the script grows more similar-name local variables in
some upcoming changes.
2018-06-28 22:05:29 +00:00
Eitan Adler
a0d30ad6a1 iwn: Correct Centrino Advanced-N 6235 constants
The iwn 6235 is a 2x2 device (see
https://ark.intel.com/products/66890/Intel-Centrino-Advanced-N-6235-Dual-Band)

Reviewed by:	adrian, kevans
Obtained from:	Haiku
2018-06-28 21:59:45 +00:00
Mark Johnston
1253de1eb6 Invalidate the mapping before updating its physical address.
Doing so ensures that all threads sharing the pmap have a consistent
view of the mapping.  This fixes the problem described in the commit
log messages for r329254 without the overhead of an extra fault in the
common case.  Once other pmap_enter() implementations are similarly
modified, the workaround added in r329254 can be removed, reducing the
overhead of CoW faults.

With this change we can reuse the PV entry from the old mapping,
potentially avoiding a call to reclaim_pv_chunk().  Otherwise, there is
nothing preventing the old PV entry from being reclaimed.  In rare
cases this could result in the PTE's page table page being freed,
leading to a use-after-free of the page when the updated PTE is written
following the allocation of the PV entry for the new mapping.

Reported and tested by:	pho
Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D16005
2018-06-28 21:40:31 +00:00
John Baldwin
a0399b42a5 Support 2GB of memory on Malta systems with FreeBSD/mips.
When 2GB of memory is enabled for QEMU's Malta emulation, the physical
memory ends at an address of 2^32 - 1.  This causes an integer overflow
to zero when computing the upper bound of the second phys_avail[] range.
As a result, FreeBSD/mips kernels were only using the first 256MB of
RAM and ignoring the remaining 1.75GB.  To work around this, truncate
the extended memory size to 2GB minus one page for 32-bit mips kernels.

Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D16027
2018-06-28 21:27:34 +00:00
John Baldwin
151578dc5f Remove the various build flag hacks for GCC cross-compile.
The xtoolchain GCC packages have not required these flags since ports
commits r465416 and r466701.  The in-tree GCC 4.2.1 has also been patched
in r335716 and r335717 to correctly honor --sysroot when looking for
includes and libraries.

Reviewed by:	bdrewery
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D16055
2018-06-28 21:26:14 +00:00
Oleksandr Tymoshenko
9e28e9855f [rpi] Add SDHOST device driver for Raspberry Pi
SDHOST is another SD controller that is present on Raspberry Pi (the
other one is SDHC and handled by bcm2835_sdhci driver). Both
controllers are capable of providing interface to SD card, actual
configuration can be set in dtb file. At the moment custom DTBs for
RPi/RPi2 have sdhost node disabled. On RPi3 sdhost is disabled in
snapshot images by applying mmc.dtbo overlay. To enalbe both devices
user has to edit config.txt on FAT partition and remove or comment
"dtoverlay=mmc" line.

When no overlay applied on RPi3 SDHOST controls SD card and SDHC
interface can be used for SDIO. mmc.dtbo overlay disables SDHOST node
and switches SD card over to SDHC.  Likewise sdhost.dtbo overlay (not
currently included in snapshot image, but can be obtained from firmare
repo[1]) disabled SDHC node and switch SD card over to SDHOST.

[1] https://github.com/raspberrypi/firmware/tree/master/boot/overlays

Submitted by:	Klaus P. Ohrhallinger <k@7he.at>
Differential Revision:	https://reviews.freebsd.org/D14168
2018-06-28 21:14:33 +00:00
David Bright
11f8e2efa8 Fix compilation error in r335765 under gcc 4.2.1.
The anonymous object initialization introduced in r335765 was
acceptable to clang, but not gcc 4.2.1. Fix it for both.

Reported by:	jhibbits@
Pointy Hat:	myself
MFC after:	1 week
X-MFC-with:	r335765
Sponsored by:	Dell EMC
2018-06-28 20:37:17 +00:00
Ed Maste
d01c382e91 Add stub arm64 linuxulator VDSO ldscript
This needs to be revisited with the VDSO implementation, but is
sufficient to allow the linux64 module to build on arm64 for testing
and development.

Sponsored by:	Turing Robotic Industries
2018-06-28 20:36:21 +00:00
Warner Losh
b77bd037a1 Revert preference to be an int.
While in base we use it as a boolean (of the wrong spelling), there's
at least one out of tree user that needs it to be int since priorirty
is a small int, not a 0/1. In deference to the time it's wasted me and
my team, push this up into FreeBSD for whatever short life boot1 may
have in the tree.
2018-06-28 19:42:10 +00:00