Commit Graph

16838 Commits

Author SHA1 Message Date
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
Konstantin Belousov
96cdb0ab9d Annotate arm userspace assembler sources stating their tolerance to
the non-executable stack.

Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
2015-09-29 16:09:58 +00:00
Xin LI
55b2d63309 Use calloc() instead of malloc + memset.
MFC after:	2 weeks
2015-09-29 04:47:31 +00:00
Jilles Tjoelker
3caeab9db2 fnmatch(): Remove exponential behaviour as in sh r229201.
The old code was exponential in the number of asterisks in the pattern.
However, once a match has been found upto the next asterisk, the previous
asterisks are no longer relevant.
2015-09-27 12:52:18 +00:00
Bryan Drewery
534ec42f5d Add missing CLEANFILES.
MFC after:	1 week
X-MFC-With:	r288199
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 01:04:52 +00:00
Bryan Drewery
ec766071e3 META_MODE: Remove DEP_MACHINE from Makefile.depend files.
This has not been needed since r246865 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:44:01 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Michael Gmelin
034fb271ae Fix non-POSIX-compliant use of getaddrinfo in libfetch
Submitted by:	Boris Kolpackov <boris@codesynthesis.com>
Reviewed by:	bapt
Approved by:	bapt
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3724
2015-09-25 14:24:23 +00:00
Bryan Drewery
660d1f65bb Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
Dimitry Andric
98e67009c0 Merge ^/head r288126 through r288196. 2015-09-24 21:48:04 +00:00
Dimitry Andric
29a2191ffe Revert r286421, now that the fix for LLVM PR24343 is in. 2015-09-24 21:39:31 +00:00
Craig Rodrigues
f1e1637581 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
Submitted by:   Sascha Wildner <swildner@dragonflybsd.org>
Obtained from:  DragonFlyBSD (commit 5d7d35b17f98588c39b30036f1a3fe8802935c2c)
2015-09-23 16:16:16 +00:00
Xin LI
9ce06829f2 MFV r288140: update file to 5.25.
MFC after:	1 month
2015-09-23 05:39:20 +00:00
Dimitry Andric
727dbcacec Merge ^/head r288100 through r288125. 2015-09-22 20:32:49 +00:00
Craig Rodrigues
c6a7de08f1 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 15:57:26 +00:00
Craig Rodrigues
587cf6827d Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 15:40:07 +00:00
Dimitry Andric
26e065d02e Merge ^/head r288035 through r288099. 2015-09-22 09:50:11 +00:00
Craig Rodrigues
3e2981e8b8 Use proper function prototype for readdir().
Eliminates -Wstrict-prototypes warning

Submitted by: Joerg Sonnenberger <joerg@dragonflybsd.org>
Obtained from: DragonFlyBSD (commit 2a6aec8dab58c89961cabcfdb92e0d0ae256dea4)
2015-09-22 07:40:55 +00:00
Craig Rodrigues
996f7159b1 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 07:31:40 +00:00
Bryan Drewery
cca3306a7f Avoid adding duplicates into OBJS. bsd.lib.mk already handles adding
entries to OBJS based on SRCS.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-22 04:55:28 +00:00
Bryan Drewery
7c6cc9de3a Fix installation of 32bit libraries after r288074.
FILES is not used when LIBRARIES_ONLY is set, which is used to build and
install the lib32 sysroot.  All of the csu files do quality as "libraries"
for this case so just undefine LIBRARIES_ONLY.

This is still better than the previous realinstall handling as it does
not hook into META_MODE properly.

Sponsored by:	EMC / Isilon Storage Division
2015-09-21 21:44:02 +00:00
Bryan Drewery
5ca34122ec Replace realinstall: and META_MODE staging hacks with FILES mechanism.
This partially reverts r270170 for lib/csu/i386 while retaining the
change for using bsd.lib.mk.

These FILES groups could go into lib/csu/Makefile.inc but I've kept them
in the Makefiles for clarity.

Sponsored by:	EMC / Isilon Storage Division
2015-09-21 18:39:13 +00:00
Dag-Erling Smørgrav
be70578239 Restore the upstream (and documented) behavior of searching for modules
both in /usr/lib and /usr/local/lib, thus simplifying the use of modules
from ports, without breaking the compat32 case again.

PR:		191151
MFC after:	3 weeks
2015-09-21 17:26:35 +00:00
Dimitry Andric
b1fa820d8b Don't install Intrin.h, as this is an intrinsics header for Windows. 2015-09-20 21:39:55 +00:00
Craig Rodrigues
3ba5ea2408 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 21:21:17 +00:00