Commit Graph

18002 Commits

Author SHA1 Message Date
Bryan Drewery
710542df20 Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired.
This uses the same fix as r294894 did for the mlock test.  The code from
that commit is moved into a common object file which PROGS supports
building first.

Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8689
2016-12-01 22:12:58 +00:00
Toomas Soome
40a969525a libstand: dosfs cstyle cleanup for return keyword.
Reviewed by:	bapt, imp, allanjude
Approved by:	imp (mentor), allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D8678
2016-12-01 19:19:20 +00:00
Conrad Meyer
103701b155 capsicum_helpers: Squash errors from closed fds
Squash EBADF from closed stdin, stdout, or stderr in caph_limit_stdio().
Any program used during special shell scripts may commonly be forked
from a parent process with closed standard stream.  Do the common sense
thing for this common use.

Reported by:	Iblis Lin <iblis AT hs.ntnu.edu.tw>
Reviewed by:	oshogbo@ (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8657
2016-12-01 17:28:45 +00:00
Martin Matuska
007dbc1f18 MFC r309362:
Sync libarchive with vendor.
Small improvements, style fixes, bugfixes.
Restores compatibility with tar archives created with Perl Archive::Tar (1)

MFC after:	1 week
Reported by:	Matthew Seaman <matthew@freebsd.org> (1)
2016-12-01 15:46:26 +00:00
Conrad Meyer
33d19692e8 Remove a death threat from the FreeBSD sources
Reported by:	koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, ngie@, cem@
Maintainer timeout:	des@
2016-12-01 02:21:36 +00:00
Martin Matuska
d5d08d297d MFV r309299:
Sync libarchive with vendor.

Important vendor bugfixes (relevant to FreeBSD):
#821: tar -P cannot extract hardlinks through symlinks
#825: Add sanity check of tar "uid, "gid" and "mtime" fields

PR:		213255
Reported by:	Tijl Coosemans <tilj@FreeBSD.org>
MFC after:	1 week
2016-11-29 22:14:42 +00:00
Ed Maste
2737721014 libm: remove duplicate version script entries
These symbols already appear in the common lib/msun/Symbol.map.
Duplicate entries produce an error with LLVM's LLD linker.

Reviewed by:	br
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8627
2016-11-29 18:40:24 +00:00
Dag-Erling Smørgrav
e68bca507d Use malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy().
This allows pw(8) to operate on passwd and group files with longer lines
than could be accomodated by a stack buffer.  It doesn't take more than a
few hundred users to exceed 8192 bytes in /etc/group.

MFC after:	3 weeks
Sponsored by:	The University of Oslo
2016-11-28 21:00:19 +00:00
Mark Johnston
64910ddbff Launder VPO_NOSYNC pages upon vnode deactivation.
As of r234483, vnode deactivation causes non-VPO_NOSYNC pages to be
laundered. This behaviour has two problems:

1. Dirty VPO_NOSYNC pages must be laundered before the vnode can be
   reclaimed, and this work may be unfairly deferred to the vnlru process
   or an unrelated application when the system is under vnode pressure.
2. Deactivation of a vnode with dirty VPO_NOSYNC pages requires a scan of
   the corresponding VM object's memq for non-VPO_NOSYNC dirty pages; if
   the laundry thread needs to launder pages from an unreferenced such
   vnode, it will reactivate and deactivate the vnode with each laundering,
   potentially resulting in a large number of expensive scans.

Therefore, ensure that all dirty pages are laundered upon deactivation,
i.e., when all maps of the vnode are removed and all references are
released.

Reviewed by:	alc, kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8641
2016-11-26 21:00:27 +00:00
Dimitry Andric
d52fad0e5d Bump FREEBSD_CC_VERSION again for r309147 and 309149. 2016-11-25 18:12:57 +00:00
Fabien Thomas
bf4356266d IPsec RFC6479 support for replay window sizes up to 2^32 - 32 packets.
Since the previous algorithm, based on bit shifting, does not scale
with large replay windows, the algorithm used here is based on
RFC 6479: IPsec Anti-Replay Algorithm without Bit Shifting.
The replay window will be fast to be updated, but will cost as many bits
in RAM as its size.

The previous implementation did not provide a lock on the replay window,
which may lead to replay issues.

Reviewed by:	ae
Obtained from:	emeric.poupon@stormshield.eu
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D8468
2016-11-25 14:44:49 +00:00
Dimitry Andric
2000ee7730 Merge ^/head r309106 through r309117. 2016-11-24 21:14:22 +00:00
Dimitry Andric
d590c67486 In preparation for merging back to head, bump __FreeBSD_version,
FREEBSD_CC_VERSION and set date in ObsoleteFiles.inc.
2016-11-24 21:12:43 +00:00
Dag-Erling Smørgrav
4e2825545b Add a warning against modifying this code without understanding it, and
an example of how not to make it more portable.  I've had this lying
around uncommitted since 2009...
2016-11-24 14:50:21 +00:00
Dimitry Andric
0ed76ec8e6 Merge ^/head r308870 through r309105. 2016-11-24 14:39:04 +00:00
Dag-Erling Smørgrav
1da400983c Remove debugging code. 2016-11-23 10:52:19 +00:00
Julian Elischer
0f7f3352c8 This little BSD licensed library has been kicking around for years.
It allows one to trivially convert an absolute path to a relative path
and the reverse. The test programs themselves are very useful in scripts
but the real use comes shortly with the -r and -a arguments to ln.
These are sometimes known as the --relative and --absolute flags and
can force a symlink to be relative when you only have an absolue path.
Another place these are sometimes used is to add -a and -r args to 'realpath'.
Incredibly useful in Makefiles.

I was going to just add the files in with 'ln' but a library makes more sense.
The test programs may come out in their own right some day for scripting.

released under a BSD 2-clause:
 * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved.
 * Copyright (c) 1999 Tama Communications Corporation. All rights reserved.

The test directry does not conform to any framework.
Not connected to build.
doc people may want to play with the manual pages.

Obtained from:  https://www.tamacom.com/pathconvert.html  Shigio Yamaguchi.
MFC after: 1 month
Relnotes:       yes
Sponsored by:   Panzura, Tama Communications Corporation
2016-11-23 07:57:52 +00:00
Jilles Tjoelker
295159dfa3 open(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW.
We return [EMLINK] instead of [ELOOP] when trying to open a symlink with
O_NOFOLLOW, so that the original case of [ELOOP] can be distinguished. Code
like cmp -h and xz takes advantage of this.

PR:		214633
Reviewed by:	kib, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D8586
2016-11-22 22:30:55 +00:00
Ed Maste
134ede2dd2 remove unnecessary vm includes from setproctitle
vm headers were needed only for the PS_STRINGS fallback, which was
removed in r297888.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-11-22 16:00:18 +00:00
Dag-Erling Smørgrav
792ef1ae7b Refactor fetch_connect() and fetch_bind() to improve readability and avoid
repeating the same DNS lookups.

MFC after:	3 weeks
2016-11-22 13:30:07 +00:00
Eric van Gyzen
81f91de9f7 Fix error reporting from wcstof()
When wcstof() skipped initial space and then parsing failed, it set
endptr to the first non-space character.  Fix it to correctly report
failure by setting endptr to the beginning of the input string.
The fix is from theraven@, who fixed this bug in wcstod() and
wcstold() in r227753.

While I'm here:

Move assignments out of declarations in wcstod() and wcstold().
This is against my personal preference, but it is our agreed style(9).

Set endptr correctly on malloc() failure in all three functions.

Remove an incorrect comment:  This is pointer arithmetic,
so the code was not actually making that assumption.

wcstold() advanced the wcp pointer beyond leading whitespace
and then reset it back to the beginning of the string.
Do not reset it.  This seems to have no functional effect,
since strtold_l() also skips leading whitespace.  I'm making
the change to keep this function consistent with wcstof() and
wcstod(), and because the C11 spec prescribes the use of iswspace()
to skip leading space.

Reported by:	libc++ unit test for std::stof(std::wstring)
MFC after:	8 days
Sponsored by:	Dell EMC
2016-11-20 20:13:22 +00:00
Justin Hibbits
4026b44790 Fix buildworld for powerpc.
vmpage requires struct pmap to exist and contain a pm_stats field.  As of
r308817, either AIM or BOOKE is required to be set in order to get their
respective pmap structs.  Rather than expose them both, or try to unify them
unnecessarily, add a third option which contains only a pm_stats field, and
change the two existing pmap structures to place the common fields at the
beginning of the struct.  This actually fixes the stats collection by libkvm on
AIM hardware, because before it was accessing a possibly different offset, which
would cause it to read garbage.

Bump __FreeBSD_version to denote this ABI change, so that ports which depend on
libkvm can be rebuilt.
2016-11-20 06:10:12 +00:00
Dimitry Andric
67bc8c8b9e Merge ^/head r308491 through r308841. 2016-11-19 16:05:55 +00:00
Alan Somers
cbaba16b23 Speed up pw operations that edit /etc/group or /etc/passwd
r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
corruption on power loss. However, it fixed it by opening those files with
O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC
with appropriately placed fsync()s instead, which is much faster. Using a
ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

Reviewed by:	allanjude, bapt, vangyzen, garga
Tested on pfSense by:	garga
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D8319
2016-11-18 16:07:08 +00:00
Gleb Smirnoff
00b5ffde8e Add flag SF_USER_READAHEAD to sendfile(2). When specified, the syscall won't
do any speculations about readahead, and use exactly the amount of readahead
specified by user.  E.g. setting SF_FLAGS(0, SF_USER_READAHEAD) will guarantee
that no readahead at all will be performed.
2016-11-17 21:36:18 +00:00
Ruslan Bukin
7804dd5212 Add full softfloat and hardfloat support for RISC-V.
Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D8529
2016-11-16 15:21:32 +00:00
Alexander Kabaev
20d197f463 Make MIPS startup assembly files use neutral float ABI.
This allows these files to be used with hard and softfloat targets
with no special flags passed to the compiler.

Reviewed by: adrian, br, imp
Differential Revision:	https://reviews.freebsd.org/D8506
2016-11-16 03:21:49 +00:00
Bryan Drewery
d329c46cfa DIRDEPS_BUILD: Connect new dependencies.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-11-13 00:11:23 +00:00
Bryan Drewery
7c6d0bb1a0 Move libsysdecode-specific hack out of buildworld.
This should fix the lib32 build since it was not removing the generated
ioctl.c.  This file is generated by a find(1) call, so cannot use normal
dependency tracking methods.

Reported by:	jhb
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-11-13 00:11:15 +00:00
Bryan Drewery
5e1eb60d94 Generate and use a proper .depend file for tables.h.
Reported by:	jhb
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-11-13 00:11:12 +00:00
Ed Maste
2ed1e385b0 libcc_{s,eh}: build without SSP
As in the gnu/lib/libgcc Makefile:
    libgcc is linked in last and thus cannot depend on ssp
    symbols coming from earlier libraries. Disable stack protection
    for this library.

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
2016-11-11 23:28:07 +00:00
Glen Barber
0eaded92d0 Spell 'PACKAGE' correctly.
Submitted by:	Kyle Evans, emaste
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2016-11-11 18:47:53 +00:00
Dimitry Andric
2828dafcf3 Merge ^/head r308227 through r308490. 2016-11-10 22:12:19 +00:00
Jason Evans
bde951447f Update jemalloc to 4.3.1. 2016-11-09 18:42:30 +00:00
Ed Maste
199f4e8d68 add missing i386 symbols libgcc_s symbol version map
After r308294 they were missing on i386 (and previously were exported
only accidentally).

Reported by:	antoine
2016-11-08 17:36:19 +00:00
Toomas Soome
cbd6713146 Loader paged/pageable data is not always paged.
This change does modify devsw dv_print() to return the int value,
enabling walkers to interrupt the walk on non zero value from dv_print().

This will allow the pager_print actually to stop displaying data on
user input, and additionally pager is used in various *dev_print callbacks,
where it was missing.

For test, lsdev [-v] command should display data by screenfuls and should
stop when the key 'q' is pressed on pager prompt.

Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D5461
2016-11-08 06:50:18 +00:00
Xin LI
a5d223e641 MFV r308392: file 5.29.
MFC after:	2 weeks
2016-11-07 15:54:47 +00:00
Edward Tomasz Napierala
319f1fd2ea Document that getfsstat(2) called with MNT_NOWAIT skips file systems
that are in the process of being unmounted.

Reviewed by:	des@ (earlier version)
MFC after:	1 month
2016-11-06 19:37:22 +00:00
Ed Maste
7f35637063 add __divdi3 and __udivdi3 to libgcc_s symbol version map
After r308294 they were missing on i386 (and previously were exported
only accidentally).

Reported by:	antoine
2016-11-06 17:21:26 +00:00
Ed Maste
c7fbd7722d Connect new LLVM-based libgcc_eh & libgcc_s to the build
Compiler-rt and LLVM's libunwind provide a suitable replacement for
libgcc.a, libgcc_eh.a, and libgcc_s.so.

Remove the now-unused LLVM_LIBUNWIND block from gnu/lib/libgcc.

PR:		213480 [exp-run]
Reviewed by:	brooks, ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8189
2016-11-04 19:35:49 +00:00
Ed Maste
e8664a318d libgcc_s: make unspecified shlib symbols local
We want only symbols explicitly specified in the Version.map.

Sponsored by:	The FreeBSD Foundation
2016-11-04 15:44:00 +00:00
Ed Schouten
34168b28e9 Replace basename(3) by a thread-safe implementation.
Now that the changes to the dirname(3) function had some time to settle,
let's go ahead and use the same approach for replacing basename(3) by a
simple implementation that modifies the input string, thereby making it
thread-safe and guaranteed to succeed.

Unlike dirname(3), this function already had a thread-safe variant
basename_r(3). This function had its own set of problems, like having an
upper bound on the pathname length. Keep this function around for
compatibility, but remove most references from the man page. Make the
man page more similar to that of dirname(3).

As the basename_r(3) function is only provided by FreeBSD (and Bionic),
depending on its use is even more implementation defined than assuming
that basename(3) is thread-safe.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D8382
2016-11-03 20:21:34 +00:00
Ruslan Bukin
2ad1d09f16 o Add support for long double.
o Add support for latest RISC-V GNU toolchain.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-11-03 13:06:17 +00:00
Dimitry Andric
a2b802ce70 Merge ^/head r303250 through r308226. 2016-11-02 19:18:24 +00:00
Ed Maste
dba5d1ca17 libm: add braces around initialization of subobjects
This cleans up a warning when building libm at higher WARNS levels and
makes the intent more clear. By the C standard the values are assigned
to subobject members in order so this change introduces no functional
change. (6.7.9 20)

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8333
2016-11-01 15:11:10 +00:00
Ruslan Bukin
77bc2a1cd6 Locale fix for endian big (EB) machines.
We have locale files generated on EL machines (e.g. during cross-build
on amd64 host), but then we are using them on EB machines (e.g. MIPS64EB),
so proceed byte-swap if necessary.

All the libc tests passed successfully, including Russian collation.

Tested by:	br@, Hongyan Xia <hx242@cam.ac.uk>
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8281
2016-11-01 13:54:44 +00:00
Dimitry Andric
02ebdc7823 Merge ^/head r307736 through r308146. 2016-10-31 19:02:42 +00:00
Ruslan Bukin
130a08a362 Detect integer overflow and limit the number of positional
arguments in the string format.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8286
2016-10-31 18:38:58 +00:00
Ruslan Bukin
5bca221511 Add full softfloat and hardfloat support for MIPS.
This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8376
2016-10-31 15:33:58 +00:00
Baptiste Daroussin
ad9f2cecd7 When issuing a PXE dhcp request, always issue a param request (DHCP option 55)
with all dhcp parameters we might be interested in.

Some DHCP server like the new kea (by ISC) expect it.

This makes pxeboot functional with ISC kea.

Submitted by:	Vincent Legout <vincent.legout@gandi.net>
MFC after:	1 month
Sponsored by:	Gandi.net
2016-10-31 15:11:55 +00:00