Commit Graph

16862 Commits

Author SHA1 Message Date
Devin Teske
1f00a99a3b dpv(3) merged to stable/10 before release/10.2.0
MFC after:	3 days
X-MFC-to:	stable/10
2015-10-23 07:34:57 +00:00
Bryan Drewery
cf07362e21 Remove more disconnected libgpib items missed in r276214.
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 03:51:25 +00:00
Enji Cooper
f487a357b7 Revert lib/libc/gen/dirname.3@r289695
This is why I use branches usually, not commit directly to head
2015-10-21 13:16:03 +00:00
Enji Cooper
6cf8c0fe51 Revert r289694
I committed some other undesirable local changes by accident
2015-10-21 13:15:04 +00:00
Conrad Meyer
8b584e9d74 cpuset.9: Link to/from the new page
A follow-up to r289667.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 23:52:37 +00:00
John Baldwin
c814b86843 Switch pl_child_pid from int to pid_t.
Reviewed by:	emaste, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3857
2015-10-20 17:58:21 +00:00
Dimitry Andric
e9ae01703c Switch the default OpenMP runtime for clang to libomp (from the LLVM
project), as libgomp is not supported anyway.  You can use the
devel/llvm-devel port to install a recent copy of the OpenMP runtime.
2015-10-18 17:18:19 +00:00
Enji Cooper
550d2b80ec Make libxo depend on libutil because it uses humanize_number after r287111
Remove overlinking in lib/libxo/tests, sbin/savecore, and
usr.bin/{iscsictl,wc,xo}

PR: 203673
Sponsored by: EMC / Isilon Storage Division
2015-10-18 07:30:50 +00:00
Conrad Meyer
7ebf41220c Document bitset(9) 2015-10-17 19:55:58 +00:00
Bryan Drewery
28a425750a Conditionalize the META_MODE tool handling on MK_META_MODE.
It was not being used outside of META_MODE but this should make it more clear
that it is only for META_MODE.

Sponsored by:	EMC / Isilon Storage Division
2015-10-17 15:50:52 +00:00
Enji Cooper
211d866621 Set dev->fd to -1 when calling cam_close_spec_device with a valid dev->fd
descriptor to avoid trashing valid file descriptors that access dev->fd at a
later point in time

PR: 192671
Submitted by: Scott Ferris <scott.ferris@isilon.com>
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-10-17 09:07:53 +00:00
Dag-Erling Smørgrav
8819003234 Use fopen()'s newfangled "e" flag instead of explicit fcntl() calls.
PR:		199801
Submitted by:	Jukka Ukkonen <jau@iki.fi>
MFC after:	1 week
2015-10-16 12:53:22 +00:00
Dag-Erling Smørgrav
c3f9b93bd9 Fix two bugs in HTTPS tunnelling:
- If the proxy returns a non-200 result, set the error code accordingly
   so the caller / user gets a somewhat meaningful error message.
 - Consume and discard any HTTP response header following the result line.

PR:		194483
Tested by:	Fabian Keil <fk@fabiankeil.de>
MFC after:	1 week
2015-10-16 12:21:44 +00:00
Bryan Drewery
aa92269e46 Add more SUBDIR_PARALLEL.
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-15 22:55:08 +00:00
Bryan Drewery
eb774fcd58 libstdc++ also snook in incorrectly in r267511, despite not being a real
subdir.

Sponsored by:	EMC / Isilon Storage Division
2015-10-15 20:49:20 +00:00
Bryan Drewery
d023e38f61 Remove unneeded libg++ reference that came in with r267511 based on a removed
comment.

Sponsored by:	EMC / Isilon Storage Division
2015-10-15 20:46:34 +00:00
Bryan Drewery
e0d253678e Fix another ++= parsed as '+=', missed in r289384.
Sponsored by:	EMC / Isilon Storage Division
2015-10-15 20:40:23 +00:00
Bryan Drewery
468a365ddd Let the SUBDIR_DEPEND*c++ variables actually work rather than being parsed
as a +=.  These were safe due to a .WAIT very early on.

Sponsored by:	EMC / Isilon Storage Division
2015-10-15 20:27:15 +00:00
Bjoern A. Zeeb
3ed01392b6 For the Cortex-A8 use the a8 and not the a9 events table.
MFC after:		2 weeks
Sponsored by:		DARPA/AFRL
Differential Revision:	https://reviews.freebsd.org/D3882
2015-10-14 16:56:25 +00:00
Eric van Gyzen
60b27ebb25 resolver: automatically reload /etc/resolv.conf
On each resolver query, use stat(2) to see if the modification time
of /etc/resolv.conf has changed.  If so, reload the file and reinitialize
the resolver library.  However, only call stat(2) if at least two seconds
have passed since the last call to stat(2), since calling it on every
query could kill performance.

This new behavior is enabled by default.  Add a "reload-period" option
to disable it or change the period of the test.

Document this behavior and option in resolv.conf(5).

Polish the man page just enough to appease igor.

https://lists.freebsd.org/pipermail/freebsd-arch/2015-October/017342.html

Reviewed by:	kp, wblock
Discussed with:	jilles, imp, alfred
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D3867
2015-10-14 14:26:44 +00:00
Enji Cooper
59e2ff550c Integrate the tests from lib/libarchive, usr.bin/cpio, and usr.bin/tar in to
the FreeBSD test suite

functional_test.sh was ported from bin/sh/tests/functional_test.sh, as a
small wrapper around libarchive_test, bsdcpio_test, and bsdtar_test provided
by upstream.

A handful of testcases in lib/libarchive/tests have been disabled as they
were failing when run with kyua test (see BROKEN_TESTS in
lib/libarchive/tests/Makefile)

As a sidenote: this removes the check/test targets from the Makefiles as they
don't match the pattern used in the rest of the FreeBSD test suite.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-10-12 18:31:21 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Edward Tomasz Napierala
92001b9497 Change the default setting of kern.ipc.shm_allow_removed from 0 to 1.
This removes the need for manually changing this flag for Google Chrome
users. It also improves compatibility with Linux applications running under
Linuxulator compatibility layer, and possibly also helps in porting software
from Linux.

Generally speaking, the flag allows applications to create the shared memory
segment, attach it, remove it, and then continue to use it and to reattach it
later. This means that the kernel will automatically "clean up" after the
application exits.

It could be argued that it's against POSIX. However, SUSv3 says this
about IPC_RMID: "Remove the shared memory identifier specified by shmid from
the system and destroy the shared memory segment and shmid_ds data structure
associated with it." From my reading, we break it in any case by deferring
removal of the segment until it's detached; we won't break it any more
by also deferring removal of the identifier.

This is the behaviour exhibited by Linux since... probably always, and
also by OpenBSD since the following commit:

revision 1.54
date: 2011/10/27 07:56:28; author: robert; state: Exp; lines: +3 -8;
Allow segments to be used even after they were marked for deletion with
the IPC_RMID flag.
This is permitted as an extension beyond the standards and this is similar
to what other operating systems like linux do.

MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3603
2015-10-10 09:29:47 +00:00
Marcel Moolenaar
1467117a05 If we can't open the file, skip devclose() for the exclusive_file_system
case. We never called devopen(), so we know there's nothing to close.
2015-10-08 17:59:05 +00:00
Peter Wemm
6cc056de26 Move SHLIBDIR?=/lib before <src.opts.mk> so that it works again. 2015-10-08 01:17:45 +00:00
Craig Rodrigues
4c92141bda Use -fpermissive if compiling with GCC.
Works around GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67888
when compiling Module.cpp
2015-10-08 00:48:29 +00:00
Craig Rodrigues
6790313541 Use proper function prototypes.
Eliminates -Wstrict-prototypes warning
2015-10-07 19:55:58 +00:00
John Baldwin
d07c923bda Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.
Reviewed by:	emaste, kib
Differential Revision:	https://reviews.freebsd.org/D3833
2015-10-07 17:52:18 +00:00
Bryan Drewery
195aef9962 truss: Add support for utrace(2).
This uses the kdump(1) utrace support code directly until a common library
is created.

This allows malloc(3) tracing with MALLOC_CONF=utrace:true and rtld tracing
with LD_UTRACE=1.  Unknown utrace(2) data is just printed as hex.

PR:		43819 [inspired by]
Reviewed by:	jhb
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D3819
2015-10-06 21:58:38 +00:00
Dimitry Andric
602af66b81 Stop linking libc++.so verbosely, there is no need to.
MFC after:	3 days
2015-10-06 21:28:54 +00:00
Dimitry Andric
9a2f5539ec For llvm/clang libraries, skip including tablegen-produced .d files when
the target is "make depend".  This works around errors during
incremental make depend of some clang libraries, for example "don't know
how to make contrib/llvm/include/llvm/IR/IntrinsicsR600.td".

Reported by:	emaste
2015-10-06 19:49:53 +00:00
Conrad Meyer
e6b95927f3 Fix core corruption caused by race in note_procstat_vmmap
This fix is spiritually similar to r287442 and was discovered thanks to
the KASSERT added in that revision.

NT_PROCSTAT_VMMAP output length, when packing kinfo structs, is tied to
the length of filenames corresponding to vnodes in the process' vm map
via vn_fullpath.  As vnodes may move during coredump, this is racy.

We do not remove the race, only prevent it from causing coredump
corruption.

- Add a sysctl, kern.coredump_pack_vmmapinfo, to allow users to disable
  kinfo packing for PROCSTAT_VMMAP notes.  This avoids VMMAP corruption
  and truncation, even if names change, at the cost of up to PATH_MAX
  bytes per mapped object.  The new sysctl is documented in core.5.

- Fix note_procstat_vmmap to self-limit in the second pass.  This
  addresses corruption, at the cost of sometimes producing a truncated
  result.

- Fix PROCSTAT_VMMAP consumers libutil (and libprocstat, via copy-paste)
  to grok the new zero padding.

Reported by:	pho (https://people.freebsd.org/~pho/stress/log/datamove4-2.txt)
Relnotes:	yes
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3824
2015-10-06 18:07:00 +00:00
Dimitry Andric
4f4bbad316 Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.7.0
release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.7.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.7.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Andrew Turner and Antoine Brodin for their help.

Exp-run:	antoine
Relnotes:	yes
2015-10-06 17:53:29 +00:00
Enji Cooper
b1c0dae171 Add directory for test encoder missed by accident in r288929
Sponsored by: EMC / Isilon Storage Division
2015-10-06 17:22:54 +00:00
Enji Cooper
f09af4b5c9 Remove a comment from an earlier iteration of trying to figure out how the
test encoder testcases worked
2015-10-06 17:18:15 +00:00
Enji Cooper
4436b51dff Integrate the tests from libxo into the FreeBSD test suite
The functional_test.sh harness for each test subdir was inspired
by the version in bin/sh/tests/functional_test.sh

Some gymnastics were required to deal with implicit rules for
.c / .o -> .out as the suffix transformation rules were
incorrectly trying to create the test outputs from some of the
source files

Sponsored by: EMC / Isilon Storage Division
2015-10-06 16:58:47 +00:00
Dimitry Andric
88750be440 Merge ^/head r288836 through r288925. 2015-10-06 16:25:13 +00:00
Enji Cooper
7fd25aff6b Use LIBXOSRC instead of LIBXO when defining the path to contrib/libxo
The latter is already defined in bsd.libnames.mk, so avoid the conflict
in case someone copy-pastes make variables

While here, switch path to the top of the source tree with SRCTOP
2015-10-06 07:28:54 +00:00
Dimitry Andric
926b24f309 Merge ^/head r288831 through r288835. 2015-10-05 20:08:11 +00:00
Jason Helfman
816c67bac0 - address grammar
PR:		203440 (based on)
Submitted by:	ceratv@rpi.edu
Approved by:	wblock@ (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3813
2015-10-05 18:09:43 +00:00
Dimitry Andric
c710e87b3b Merge ^/head r288457 through r288830. 2015-10-05 17:54:54 +00:00
Dimitry Andric
bb52ed3249 Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259).
This has also been submitted upstream.
2015-10-05 17:47:23 +00:00
Mark Johnston
403ec61cbb Revert r288628 and instead fix a discrepancy between the posix_fadvise(2)
man page and POSIX: posix_fadvise(2) returns an error number on failure.

Reported by:	jilles
MFC after:	1 week
2015-10-03 22:27:14 +00:00
Bryan Drewery
7bab754097 Include stddef.h for ptrdiff_t 2015-10-03 20:06:50 +00:00
Bryan Drewery
43fa36d52c Remove redundant COMPAT_32BIT guard on pkgconfig files. This is already handled
by the LIBRARIES_ONLY mechanism protecting FILES.

Sponsored by:	EMC / Isilon Storage Division
2015-10-03 16:34:21 +00:00
Hiroki Sato
4c60a05d25 - Move PF_LOCAL at the end of the array. PF_INET{,6} is used more often.
- Add SOCKTYPE_ANY to PF_LOCAL.

- Apply AI_CANONNAME to only AF_INET{,6}.  It is not meaningful for the
  other AFs.
2015-10-03 12:40:54 +00:00
Dimitry Andric
65dcb5bcb1 Merge ^/head r288197 through r288456. 2015-10-01 19:02:45 +00:00
Jilles Tjoelker
d358fa780b wordexp: Rewrite to make WRDE_NOCMD reliable.
Shell syntax is too complicated to detect command substitution and unquoted
operators reliably without implementing much of sh's parser. Therefore, have
sh do this detection.

While changing sh's support anyway, also read input from a pipe instead of
arguments to avoid {ARG_MAX} limits and improve privacy, and output count
and length using 16 instead of 8 digits.

The basic concept is:
execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2",
    "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>);

The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to
fail strings containing unquoted braces with code WRDE_BADCHAR. Since this
is normally not a syntax error in sh, there is still a need for checking
code in libc, we_check().

The new we_check() is an optimistic check that all the characters
  <newline> | & ; < > ( ) { }
are quoted. To avoid duplicating too much sh logic, such characters are
permitted when quoting characters are seen, even if the quoting characters
may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad
characters that get past it and are a syntax error in sh return WRDE_SYNTAX.

Although many implementations of WRDE_NOCMD erroneously allow some command
substitutions (and ours even documented this), there appears to be code that
relies on its security (codesearch.debian.net shows quite a few uses).
Passing untrusted data to wordexp() still exposes a denial of service
possibility and a fairly large attack surface.

Reviewed by:	wblock (man page only)
MFC after:	2 weeks
Relnotes:	yes
Security:	fixes command execution with wordexp(untrusted, WRDE_NOCMD)
2015-09-30 21:32:29 +00:00
Bryan Drewery
66157b3899 Fix 'ugidfw remove' after r284251 incorrectly changed it.
The sysctl_rule() node removes entries when given a newptr and newlen == 0.
2015-09-29 18:48:12 +00:00
Xin LI
b95523e859 In this context fclose() can never fail, so assert it in the test
case.
2015-09-29 17:54:28 +00:00