Commit Graph

7058 Commits

Author SHA1 Message Date
Cy Schubert
53362bdcc5 Remove dead code.
Approved by:	re@ (hrs@)
MFC after:	1 week
2016-06-30 14:53:46 +00:00
Martin Matuska
ae5876ea19 MFV r302264:
Sync libarchive with vendor, bugfixes for tests:
- fix tests on filesystems without birthtime support, e.g. UFS1 (1)
- vendor issue #729: avoid use of C99 for-scope declarations in
  test_write_format_gnutar_filenames.c

MFC after:	1 week
PR:		204157 (1)
Approved by:	re (hrs)
2016-06-30 08:51:50 +00:00
Bryan Drewery
eb39a64db8 Flush every line when using meta mode and no -j or with -B.
Otherwise the output is buffered and it appears that make is stuck on something
long-running.  This problem is not present with -j as it uses different
code that was already flushing.

Discussed with:	sjg
Approved by:	re (blanket, META_MODE)
Sponsored by:	EMC / Isilon Storage Division
2016-06-29 22:54:01 +00:00
Xin LI
282e23f07b MFV r302218: file 5.28.
Relnotes:	yes
MFC after:	2 weeks
Approved by:	re (gjb)
2016-06-27 01:29:17 +00:00
Martin Matuska
f061a2215f MFV r302003,r302037,r302038,r302056:
Update libarchive to 3.2.1 (bugfix and security fix release)

List of vendor fixes:
- fix exploitable heap overflow vulnerability in Rar decompression
  (vendor issue 719, CVE-2016-4302, TALOS-2016-0154)
- fix exploitable stack based buffer overflow vulnebarility in mtree
  parse_device functionality (vendor PR 715, CVE-2016-4301, TALOS-2016-0153)
- fix exploitable heap overflow vulnerability in 7-zip read_SubStreamsInfo
  (vendor issue 718, CVE-2016-4300, TALOS-2016-152)
- fix integer overflow when computing location of volume descriptor
  (vendor issue 717)
- fix buffer overflow when reading a crafred rar archive (vendor issue 521)
- fix possible buffer overflow when reading ISO9660 archives on machines
  where sizeof(int) < sizeof(size_t) (vendor issue 711)
- tar and cpio should fail if an input file named on the command line is
  missing (vendor issue 708)
- fix incorrect writing of gnutar filenames that are exactly 512 bytes
  long (vendor issue 682)
- allow tests to be run from paths that are equal or longer than 128
  characters (vendor issue 657)
- add memory allocation errors in archive_entry_xattr.c (vendor PR 603)
- remove dead code in archive_entry_xattr_add_entry() (vendor PR 716)
- fix broken decryption of ZIP files (vendor issue 553)
- manpage style, typo and description fixes

Post-3.2.1 vendor fixes:
- fix typo in cpio version reporting (Vendor PR 725, 726)
- fix argument range of ctype functions in libarchive_fe/passphrase.c
- fix ctype use and avoid empty loop bodies in WARC reader

MFC after:	1 week
Security:	CVE-2016-4300, CVE-2016-4301, CVE-2016-4302
Approved by:	re (kib)
2016-06-22 07:49:59 +00:00
Bryan Drewery
da64d1122d Import ClangFormat.cpp from ^/vendor/clang/clang-release_380-r262564
Discussed with:	dim
Approved by:	re (gjb)
2016-06-17 16:44:31 +00:00
Simon J. Gerraty
ad7fb14f52 meta_oodate: set needOODATE if oodate due to missing .meta file.
Reviewed by:	bdrewery
Approved by:	re
2016-06-14 23:52:32 +00:00
Kurt Lidl
74bc093c1c Add ipfilter support to blacklistd-helper
In addition to adding initial support for the ipfilter
packet filtering system, wrap a few long lines, perform
whitespace cleanup and sync with upstream changes made
in NetBSD.

Submitted by:	cy
Reviewed by:	cy
Approved by:	re (hrs)
Relnotes:	YES
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6823
2016-06-12 23:34:48 +00:00
Cy Schubert
ca94cc3b74 Clarify the wording to be more accurate.
Approved by:	re@ (gjb)
MFC after:	1 week
X-MFC with:	r301773
2016-06-10 01:10:48 +00:00
Cy Schubert
dbef02b209 Update the man ipf.8 man page to accurately reflect that the -6
option is a noop and only here for backward compatibility.

MFC after:	1 week
2016-06-10 00:06:58 +00:00
Dag-Erling Smørgrav
3f68b24e10 Update to latest upstream version
PR:		209177
Reported by:	Vitaly Magerya
MFC after:	1 week
2016-06-09 20:40:12 +00:00
Enji Cooper
86c9d9918f Fix up r274061
Detect /usr/share/dict/words the "right way" by using require.files instead of
the hacked up attempt in the dict(..) function, which didn't work properly on
systems where MK_DICT == no.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-06-09 19:12:51 +00:00
Enji Cooper
d44d3fbae9 Update goodResult after recent changes made to the PRNG in libc
The PRNG was changed in r300953/r300956, and subsequently, the numbers
generated have changed. This is expected ABI breakage per ache

X-MFC with: r300953, r300956
Tested with: amd64, i386
Sponsored by: EMC / Isilon Storage Division
2016-06-09 18:35:37 +00:00
Enji Cooper
54ab80ee61 Add debug output to aid in determining why goodResult != result
MFC after: 1 week
PR: 210619 (for diagnosis)
Sponsored by: EMC / Isilon Storage Division
2016-06-09 18:11:42 +00:00
Kurt Lidl
5cc0844d4b Add IPFW support to blacklistd-helper
Relnotes:	YES
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6753
2016-06-09 15:19:48 +00:00
Jason Evans
62b2691e48 Update jemalloc to 4.2.1. 2016-06-09 06:10:20 +00:00
Mariusz Zaborski
9f51f38916 The code responsible for opening and rotating pcap files is independent
of Capser and should use openat(2) unconditionally on FreeBSD.
openat(2) is mandatory when sandboxed with Capsicum, but still works
in the absence of Capsicum.

Reviewed by:	AllanJude
2016-06-08 23:22:59 +00:00
Mariusz Zaborski
e29a5e1bb9 Fix spelling of the casper introduced in the r296047.
PR:		210031
Reported by:	AllanJude, jmallett
2016-06-08 22:30:21 +00:00
Ed Schouten
2c7da872aa Don't let ATF call basename() and dirname() in a non-standard way.
POSIX basename() and dirname() are allowed to overwrite the input
buffer. The advantage of implementing it that way is that the functions
can be thread-safe, as they don't store the result in a global buffer.

It looks like ATF wants to call basename() and dirname() in the
non-standard way where the argument is of type "const char *". This
change disables the calls to basename() and dirname(), which only seems
to affect the formatting of some rare debug/error messages.

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D6627
2016-06-08 20:54:56 +00:00
Pedro F. Giffuni
c8b6d1e472 Revert r301689 - one-true-awk: Avoid a NULL dereference.
I got this wrong and the coverity report doesn't match the NetBSD change,
which was thought for a different version.

The change wouldn't hurt but let's wait until upstream figures this out.
2016-06-08 19:39:44 +00:00
Pedro F. Giffuni
17ce5a9b90 one-true-awk: Avoid a NULL dereference.
CID:		270862
Obtained from:	NetBSD (CVS Rev. 1.8)
MFC after:	2 weeks
2016-06-08 19:24:48 +00:00
Brooks Davis
8dfeba04eb Update to a June 8th snapshot of (un)vis form NetBSD.
This adds stravis() and some new encoding flags VIS_SHELL, VIS_META,
and VIS_NOLOCALE.

Assorted cleanups and fixes includeing a manpage typo[0].

PR:		210013 [0]
Submitted by:	pi [0]
2016-06-08 18:21:27 +00:00
Simon J. Gerraty
39ac7ef49a Merge bmake-20160606
o dir.c: extend mtimes cache to others via cached_stat()
2016-06-08 17:51:21 +00:00
Renato Botelho
d87f5e3055 Move misplaced break statement to right place
Reported by:	Coverity
CID:		1304340
Reviewed by:	lidl
Differential Revision:	https://reviews.freebsd.org/D6749
Sponsored by:	Rubicon Communications (Netgate)
2016-06-08 11:58:03 +00:00
Kurt Lidl
04a83165f2 Bump dates in blacklist related manpages
Reported by:	araujo
Sponsored by:	The FreeBSD Foundation
2016-06-07 16:51:56 +00:00
Kurt Lidl
9349564fec Note blacklist support first appeared in FreeBSD 11
Reported by:	jbeich
Sponsored by:	The FreeBSD Foundation
2016-06-07 16:26:34 +00:00
Bryan Drewery
94bb24b387 Use the in-tree sys/elf_common.h to build libelftc.
This fixes build failures on older releases that lack various
definitions such as EM_AARCH64 (which was unfixed before this).

Revert all of the recent compatibility changes that worked around this
problem.

This uses the same method of using the in-tree header as lib/libelf,
lib/libdwarf and usr.bin/readelf.

Reviewed by:	emaste
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6734
2016-06-05 23:05:14 +00:00
Simon J. Gerraty
b778b302be Import bmake-20160604
Performace improvements for meta mode.
2016-06-05 20:26:16 +00:00
Baptiste Daroussin
3933ba6b0d Fix build with external gcc
Completly disable some extra optimisation for very recent gcc.
They would require some updated in the runtime which we do not have yet
2016-06-05 11:56:03 +00:00
Baptiste Daroussin
912517a7d4 Ensure old gcc does not accidently get the attributes it does not know about 2016-06-05 09:38:48 +00:00
Baptiste Daroussin
6525738f63 Import libucl snapshot 20160604
It replaces xxhash with mumhash
It fixes issues with msgpack on non x86
2016-06-04 14:57:25 +00:00
Pedro F. Giffuni
e8c66cf087 libiberty: prevent integer overflow.
Take care of very old bug leading to heap-buffer overflow by
processing certain file headers via bfd binary.

PR:		200888
Obtained from:	OpenBSD
MFC after:	2 weeks
2016-06-03 21:37:24 +00:00
Pedro F. Giffuni
9051825205 MFV r300961:
one-true-awk: replace 0 with NULL for pointers

Also remove a redundant semicolon.
2016-06-03 21:23:11 +00:00
Xin LI
e27abb6689 MFV r301238:
ntp 4.2.8p8.

Security:	CVE-2016-4957, CVE-2016-4953, CVE-2016-4954
Security:	CVE-2016-4955, CVE-2016-4956
Security:	FreeBSD-SA-16:24.ntp
With hat:	so
2016-06-03 08:00:22 +00:00
Dimitry Andric
b5e99283f4 Pull in r271548 from upstream llvm trunk (by me):
Only attempt to detect AVG if SSE2 is available

  Summary:
  In PR29973 Sanjay Patel reported an assertion failure when a certain
  loop was optimized, for a target without SSE2 support.  It turned out
  this was because of the AVG pattern detection introduced in rL253952.

  Prevent the assertion failure by bailing out early in
  `detectAVGPattern()`, if the target does not support SSE2.

  Also add a minimized test case.

  Reviewers: congh, eli.friedman, spatel

  Subscribers: emaste, llvm-commits

  Differential Revision: http://reviews.llvm.org/D20905

This should fix assertion failures ("Requires at least SSE2!") when
building the games/0ad port with CPUTYPE=pentium3.

Reported by:	madpilot
2016-06-02 19:54:38 +00:00
Kurt Lidl
1d0f5925cd Fixup path in NetBSD supplied documentation for FreeBSD
NetBSD installs the blacklist-helper script in /libexec, and
it goes into /usr/libexec on FreeBSD.  Update the docs to
match FreeBSD's installation location.

Reviewed by:	rpaulo
Approved by:	rpaulo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6592
2016-06-02 18:25:32 +00:00
Kurt Lidl
12017ca883 Import NetBSD's blacklist source from vendor tree
This import includes The basic blacklist library and utility programs,
to add a system-wide packet filtering notification mechanism to
FreeBSD.

The rational behind the daemon was given by Christos Zoulas in a
presentation at vBSDcon 2015: https://youtu.be/fuuf8G28mjs

Reviewed by:	rpaulo
Approved by:	rpaulo
Obtained from:	NetBSD
Relnotes:	YES
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5912
2016-06-01 22:04:10 +00:00
Dimitry Andric
f8789c6b84 Pull in r269908 from upstream llvm trunk (by James Molloy):
[VectorUtils] Fix nasty use-after-free

  In truncateToMinimalBitwidths() we were RAUW'ing an instruction then
  erasing it. However, that intruction could be cached in the map we're
  iterating over. The first check is "I->use_empty()" which in most
  cases would return true, as the (deleted) object was RAUW'd first so
  would have zero use count. However in some cases the object could
  have been polluted or written over and this wouldn't be the case.
  Also it makes valgrind, asan and traditionalists who don't like their
  compiler to crash sad.

  No testcase as there are no externally visible symptoms apart from a
  crash if the stars align.

  Fixes PR26509.

This should fix crashes when building a number of ports on arm64.

Reported by:	andrew
2016-05-29 20:54:16 +00:00
Ed Schouten
a25e1dd4df Replace local prototype of basename() with an inclusion of <libgen.h>.
libiberty currently defines the prototype for basename() itself instead
of using <libgen.h>. It still uses the BSD-style prototype instead of
the POSIX one, meaning that if FreeBSD would switch over to the POSIX
one, you wouldn't be able to use libiberty.h and libgen.h in a single
source file. It turns out that kgdb does this. Patch up libiberty to
just include <libgen.h>.

I'm currently talking to upstream to see whether we can come up with a
more complete solution that could be integrated, but for our
unmaintained copy of GDB in base, let's just apply the simplest
workaround possible.

Reviewed by:	pfg
Differential Revision:	https://reviews.freebsd.org/D6631
2016-05-29 16:10:01 +00:00
Phil Shafer
ee5cf11617 Submitted by: phil
Reviewed by:	sjg (mentor)
Approved by:	sjg
2016-05-29 01:43:28 +00:00
Phil Shafer
c563bbe1a9 Undo meaningless local changes to libxo so we're in sync with the github repo.
Submitted by:	phil
Reviewed by:	sjg (mentor)
Approved by:	sjg
2016-05-28 19:39:15 +00:00
Conrad Meyer
2844d30cc5 gcc42: Fix minor C99 parse bug
DR #289[0] came down and gcc4.2.1 was on the wrong side of history.
Partially revert GCC r42574 (just remove the error) to rectify the parse
bug to match Clang and other compliant C99 compilers.

An example declaration gcc tripped on before this fix:

  void foobar(int [static 1]);

An example declaration gcc did not trip on before this fix:

  void foobar(int name[static 1]);

Bump __FreeBSD_cc_version.

[0]: http://www.open-std.org/JTC1/SC22/WG14/www/docs/dr_289.htm

Reported by:	allanjude
Sponsored by:	EMC / Isilon Storage Division
2016-05-27 03:40:52 +00:00
Dimitry Andric
9729cf0934 Update libc++ to 3.8.0. Excerpted list of fixes (with upstream revision
numbers):

r242679 Implement the plugin-based version of std::search. There are no
        searchers yet; those are coming soon.
r242682 Implement the default searcher for std::experimental::search.
r243728 Add <experimental/any> v2.
r245330 implement more of N4258 - Cleaning up noexcept in the standard
        library. Specifically add new noexcept stuff to vector and
	string's move-assignment operations
r245334 Fix PR22606 - Leak pthread_key with static storage duration to
        ensure all of thread-local destructors are called.
r245335 Fix PR23589: std::function doesn't recognize null pointer to
        varargs function.
r247036 Implementation of Boyer-Moore and Boyer-Moore-Horspool
        searchers for the LFTS.
r249325 Implement LWG#2063, and update the issues links to point to the
        github generated pages
r249738 Split <ctype.h> out of <cctype>.
r249739 Split <errno.h> out of <cerrno>.
r249740 Split <float.h> out of <cfloat>.
r249741 Split <inttypes.h> out of <cinttypes>.
r249742 Split <math.h> out of <cmath>.
r249743 Split <setjmp.h> out of <csetjmp>.
r249761 Split <stddef.h> out of <cstddef>.
r249798 Split <stdio.h> out of <cstdio>.
r249800 Split <stdlib.h> out of <cstdlib>.
r249889 Split <wchar.h> out of <cwchar>.
r249890 Split <wctype.h> out of <cwctype>.
r249929 Split <string.h> out of <cstring>.
r250254 ABI versioning macros for libc++.
r251246 Fix LWG#2244: basic_istream::seekg
r251247 Fix LWG#2127: Move-construction with raw_storage_iterator.
r251253 Fix LWG#2476: scoped_allocator_adaptor is not assignable
r251257 Fix LWG#2489: mem_fn() should be noexcept
r251618 Implement P0004R1 'Remove Deprecated iostreams aliases'
r251766 Implement the first part of P0006R0: Adopt Type Traits Variable
        Templates for C++17.
r252195 Implement P0092R1 for C++1z
r252350 Allow deque to handle incomplete types.
r252406 More of P0006R0: type traits variable aliases for C++17.
r252407 Implement LWG#2353: std::next is over-constrained
r252905 Implement P0074: Making owner_less more flexible
r253215 Implement P0013R1: Logical Operator Type Traits.
r253274 Implement P0007: Constant View: A proposal for a std::as_const
        helper function template.
r254119 Add static_assert to set/multiset/map/multimap/forward_list/deque
        that the allocator's value_type match the container's value_type.
r254283 Implement more of P0006; Type Traits Variable Templates.
r255941 LWG2485: get() should be overloaded for const tuple&&.
r256325 Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default
        constructors.
r256652 Fix for ALL undefined behavior in <list>.
r256859 First half of LWG#2354: 'Unnecessary copying when inserting
        into maps with braced-init syntax'

Exp-run:	antoine
Relnotes:	yes
2016-05-26 18:52:49 +00:00
Enji Cooper
6ab86b0f62 The readme provides a high-level overview of how to upgrade top(1).
Differential Revision: https://reviews.freebsd.org/D6493
MFC after: 1 week
Reviewed By: ngie
Submitted by: Randy Westlund <rwestlun@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2016-05-26 07:09:42 +00:00
Ed Maste
d38447b51d Update to ELF Tool Chain r3477
This fixes a EFI/PE header issue that prevented elfcopy-produced .efi
files from working with Secure Boot:

  Make sure section raw size is always padded to multiple of
  FileAlignment from the optional header, as requested by the PE
  specification. This change should reduce the diff between PE image
  generated by Binutils objcopy and elftoolchain elfcopy.

Submitted by:	kaiw
Reported by:	ambrisko
2016-05-25 20:56:30 +00:00
Ruslan Bukin
b7b46892f9 Remove legacy brk and sbrk from RISC-V.
Discussed with:	andrew
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-05-25 14:08:21 +00:00
Ruslan Bukin
ce35ddbc74 Add relocation support for RISC-V.
Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D6559
2016-05-25 11:58:55 +00:00
Enji Cooper
96331b7705 Silence top(1) compiler warnings
The contrib/top code is no longer maintained upstream (last pulled 16 years
ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type
warnings, amongst others. This silences 131 warnings with as little modification
as possible by adding necessary return types, definitions, headers, and header
guards, and missing header includes.

The 5 warnings that remain are due to undeclared ncurses references. I didn't
include curses.h and term.h because there are several local functions and macros
that conflict with those definitions.

MFC after: 3 weeks
Reviewed by: cem, ngie
Submitted by: Randy Westlund <rwestlun@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6468
2016-05-22 04:17:00 +00:00
Ed Maste
bcf9fc28f6 elftoolchain: backwards compatability for ELFOSABI_CLOUDABI definition
It is not provided by sys/elf_common.h on older releases or -current
before March 2015.

Reported by:	Jenkins
2016-05-21 15:38:40 +00:00
Ed Maste
bdef86c693 elftoolchain: backwards compatability for EM_RISCV definition
It is not provided by sys/elf_common.h on older releases

Reported by:	Jenkins
2016-05-20 20:27:30 +00:00
Pedro F. Giffuni
3b6f4eae15 gas: Implement the .inst assembler directive for arm.
We normally use the binutils from ports but on other systems this
is required for building gcc 4.9.

Obtained from:	OpenBSD (CVS rev. 1.5)
MFC after:	3 weeks
2016-05-20 20:01:10 +00:00
Ed Maste
d28b40c8d9 elftoolchain: backwards compatability for EM_IAMCU definition
It is not provided by sys/elf_common.h on older stable/10.
2016-05-20 18:54:42 +00:00
Pedro F. Giffuni
0d1bd3bc60 GCC: Add support for named initializers for anonymous structs/unions.
Missing hunk from r300301.

Reported by:	Ed Schouten
Obtained from:	OpenBSD (CVS rev. 1.2)
2016-05-20 18:01:53 +00:00
Dimitry Andric
dd8214827f Pull in r270240 from upstream clang trunk (by me):
Make __FreeBSD_cc_version predefined macro configurable at build time

  The `FreeBSDTargetInfo` class has always set the `__FreeBSD_cc_version`
  predefined macro to a rather static value, calculated from the major OS
  version.

  In the FreeBSD base system, we will start incrementing the value of this
  macro whenever we make any signifant change to clang, so we need a way
  to configure the macro's value at build time.

  Use `FREEBSD_CC_VERSION` for this, which we can define in the FreeBSD
  build system using either the `-D` command line option, or an include
  file.  Stock builds will keep the earlier value.

  Differential Revision: http://reviews.llvm.org/D20037

Follow-up commits will start using the __FreeBSD_cc_version to determine
whether a bootstrap compiler has to be built during buildworld.
2016-05-20 17:38:45 +00:00
Simon J. Gerraty
e48f47ddc1 Merge bmake-20160512 2016-05-20 17:35:39 +00:00
Ed Maste
b6b6f9cc7c Update to ELF Tool Chain r3475
Improvements include:

 * Add support for reporting and handling a number of new constants in
   various tools, including:
    * CloudABI OSABI
    * DT_TLSDESC_*
    * i386, MIPS, SPARC and amd64 relocations

 * C++ demangler bug fixes

 * Man page updates

 * Improved input validation in several tools

This update also reduces diffs against upstream as a number of fixes
included in upstream were previously cherry-picked into FreeBSD.

Sponsored by:	The FreeBSD Foundation
2016-05-20 17:24:34 +00:00
Pedro F. Giffuni
2c9dee79ef gas/config/tc-arm.c: Minor re-sorting to match upstream history.
No functional change.

MFC after:	2 weeks
2016-05-20 15:14:38 +00:00
Andrew Turner
94098ab7c3 Remove brk and sbrk from arm64. They were defined in The Single UNIX
Specification, Version 2, but marked as legacy, and have been removed from
later specifications. After 12 years it is time to remove them from new
architectures when the main use for sbrk is an invalid method to attempt
to find how much memory has been allocated from malloc.

There are a few places in the tree that still call sbrk, however they are
not used on arm64. They will need to be fixed to cross build from arm64,
but these will be fixed in a follow up commit.

Old copies of binutils from ports called into sbrk, however this has been
fixed around 6 weeks ago. It is advised to update binutils on arm64 before
installing a world that includes this change.

Reviewed by:	brooks, emaste
Obtained from:	brooks
Relnotes:	yes
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D6464
2016-05-20 15:04:48 +00:00
Pedro F. Giffuni
b7505e07e5 GCC: Add support for named initializers for anonymous structs/unions.
This is a C11 feature that is starting to get used in places such as Mesa.
This implementation takes a different approach to upstream and is
therefore not covered by GPLv3.

Obtained from:	OpenBSD (CVS rev. 1.2)
MFC after:	3 weeks
2016-05-20 14:36:49 +00:00
Cy Schubert
17dd2ae7fb Fix another typo.
Reported by:	cem
MFC after:	6 days
2016-05-19 03:18:54 +00:00
Cy Schubert
0003f67197 Fix typo.
Reported by:	Ruben Kerkhof <ruben@rubenkerkhof.com>
MFC after:	6 days
2016-05-19 02:06:48 +00:00
Gleb Smirnoff
9aa8749970 Revert r299830, it has couple of fatal errors.
The CMSG_ family of macros take care of alignment, so we don't need r299830
at all, even if it was correct.  Put NO_WCAST_ALIGN into Makefile.

Together with:	peter
2016-05-18 22:02:19 +00:00
Konstantin Belousov
71edebc7d5 Add SUSv4 reference macro to our groff mdoc. mdocml already supports it.
Sponsored by:	The FreeBSD Foundation
2016-05-17 09:24:54 +00:00
Martin Matuska
c38ff13d6a Revert r299576 and MFV r299895:
Revert r299576:
Fix broken cpio behavior.

MFV r299895:
Update to vendor git commit 860ec63.

MFC after:	3 weeks (together with libarchive 3.2.0)
Fix broken cpio behavior in pass-through mode with vendor code.
2016-05-16 05:01:44 +00:00
Enji Cooper
9ea0bf43e5 Fix .Dd
Today is the 14th, not the 10th of May

Reported by: igor (derp)
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:44:32 +00:00
Enji Cooper
9e1f7d9aa0 Fix fully canonicalized example for myvariable.27...
`6` doesn't occur in the OID; it was spurious

Bump .Dd for the change

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:43:36 +00:00
Enji Cooper
3b8e9f554f Remove trailing whitespace in license tort
MFC after: 1 week
Reported by: igor
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:41:01 +00:00
Enji Cooper
09ac27c318 Fix -Wcast-align warnings
Use memcpy instead of using direct assignment of void* pointers with
CMSG_DATA(..), which changes alignment

MFC after: 3 weeks
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:36:19 +00:00
Enji Cooper
126b5bb6a4 Use SNMPD_INPUT_FAILED instead of SNMP_CODE_FAILED
SNMPD_INPUT_FAILED is `enum snmpd_input_err` type (which matches the return
code from the function). SNMP_CODE_FAILED is `enum snmp_code` type.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:54:21 +00:00
Enji Cooper
a7ff045627 Use sizeof(..)s for the destination buffers instead of hardcoded values corresponding
to the destination buffer sizes

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:13:36 +00:00
Enji Cooper
d208c8fa3f Replace QUADFMT with %ju and QUADXFMT with %jx and cast values with uintmax_t
This will cure some -Wformat warnings

MFC after: 1 week
Reported by: clang, gcc
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:10:37 +00:00
Xin LI
20f8619da0 MFV r299716: file 5.27
MFC after:	2 weeks
Relnotes:	yes
2016-05-14 08:52:37 +00:00
Jason Evans
fbb1d85eb3 Work around invalid gcc warning (explicit cast apparently lost). 2016-05-13 21:18:10 +00:00
Jason Evans
1f0a49e863 Update jemalloc to 4.2.0. 2016-05-13 04:03:20 +00:00
Martin Matuska
ec0bb2035e Fix broken cpio behavior.
Suggested upstream as PR #704.

MFC:	1 month (together with libarchive 3.2.0)
2016-05-12 22:51:04 +00:00
Martin Matuska
cdf63a700c MFV r299425:
Update libarchive to 3.2.0

New features:
- new bsdcat command-line utility
- LZ4 compression (in src only via external utility from ports)
- Warc format support
- 'Raw' format writer
- Zip: Support archives >4GB, entries >4GB
- Zip: Support encrypting and decrypting entries
- Zip: Support experimental streaming extension
- Identify encrypted entries in several formats
- New --clear-nochange-flags option to bsdtar tries to remove noschg and
  similar flags before deleting files
- New --ignore-zeros option to bsdtar to handle concatenated tar archives
- Use multi-threaded LZMA decompression if liblzma supports it
- Expose version info for libraries used by libarchive

Patched files (fixed compiler warnings):

contrib/libarchive/cat/bsdcat.c (vendor PR #702)
contrib/libarchive/cat/bsdcat.h (vendor PR #702)
contrib/libarchive/libarchive/archive_read_support_format_mtree.c (PR #701)
contrib/libarchive/libarchive_fe/err.c (vendor PR #703)

MFC after:	1 month
Relnotes:	yes
2016-05-12 10:16:16 +00:00
Conrad Meyer
6c8eb57da5 atf map: Fix double-free in low memory error path
If atf_list_append(, X, ) fails, X is freed.  Don't free it again.

If anyone wants to walk this patch upstream, be my guest.  I literally cannot
upstream it myself due to Google's stupid CLA.

Reported by:	Coverity
CID:		979936
Sponsored by:	EMC / Isilon Storage Division
2016-05-11 23:39:39 +00:00
Conrad Meyer
4aa1608aee bsnmpd: Fix size of trapsink::comm to match other community arrays
This fixes a number of possible strcpy() buffer overruns between the various
community strings in trap.c.

Reported by:	Coverity
CIDs:		1006820, 1006821, 1006822
Sponsored by:	EMC / Isilon Storage Division
2016-05-11 17:06:03 +00:00
Conrad Meyer
5f0d846034 bsnmp: Don't overrun privkey buffer by copying wrong size
The 'priv_key' array is SNMP_PRIV_KEY_SIZ bytes, not SNMP_AUTH_KEY_SIZ.

Reported by:	Coverity
CIDs:		1008326, 1009675
Sponsored by:	EMC / Isilon Storage Division
2016-05-11 16:54:34 +00:00
Martin Matuska
4e579f6c94 Update vendor/libarchive/dist to git commit 61c56e5 (post 3.2.0) 2016-05-11 10:19:44 +00:00
Martin Matuska
8c8f03ca5b Keep full libarchive distribution in vendor branch (prep for 3.2.0 update) 2016-05-11 10:10:11 +00:00
Martin Matuska
43341e7cf4 Trim libarchive/dist using FREEBSD-Xlist 2016-05-10 21:12:32 +00:00
Baptiste Daroussin
053a88680a Rename getline with get_line to avoid collision with getline(3)
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard

Obtained from:	OpenBSD
2016-05-10 11:09:26 +00:00
Bryan Drewery
29df9f6b75 DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools.
This avoids running target binaries.

Sponsored by:	EMC / Isilon Storage Division
2016-05-09 22:21:09 +00:00
Xin LI
53021c7e30 MFV r299237: apply two upstream revisions to address upstream bug PR/540.
PR:		209211
MFC after:	2 weeks
X-MFC:		if there is no new file release
2016-05-08 18:18:35 +00:00
Xin LI
7206c4fc60 MFV r299233: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:
Revert: Don't close stdin...

This have been observed by portupgrade in its interaction with file(1),
as reported as a regression in bin/209211.

PR:		209211
MFC after:	3 days
2016-05-08 09:30:36 +00:00
Dimitry Andric
076e75ebe4 Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef.
Interesting fixes:
3adaa2e Fix _Unwind_Exception cleanup functions
286776c Check exception cleanup function ptr before calling
edda626 Correct exception specifications on new and delete operators
2016-05-05 22:40:07 +00:00
Dimitry Andric
747872f83f Re-sync the FreeBSD-specific Subversion template with the one from
ports.

MFC after:	11 days
X-MFC-With:	r298845
2016-05-03 18:06:42 +00:00
Dimitry Andric
4c4924e8b0 Update from subversion 1.9.2 to 1.9.4.
This contains only bug fixes, no new features.  The repository format is
also unchanged from 1.9.2.  Full list of changes between 1.9.4 and
earlier versions:

  https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES

Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and
CVE-2016-2168) do not affect the version of Subversion in the FreeBSD
base system, since neither SASL nor Apache modules are enabled.

Relnotes:	yes
MFC after:	2 weeks
2016-04-30 10:35:42 +00:00
Andrew Turner
4b6f23dfaf Stop using sbrk(2) with malloc. This helps reduce the number of places
within the tree where we call this legacy interface.

Reviewed by:	jasone
Obtained from:	brooks
Sponsored by:	ABT Systems Ltd
2016-04-28 12:24:58 +00:00
Xin LI
4990d495fc MFV r298691:
ntp 4.2.8p7.

Security:	CVE-2016-1547, CVE-2016-1548, CVE-2016-1549, CVE-2016-1550
Security:	CVE-2016-1551, CVE-2016-2516, CVE-2016-2517, CVE-2016-2518
Security:	CVE-2016-2519
Security:	FreeBSD-SA-16:16.ntp
With hat:	so
2016-04-27 07:46:38 +00:00
Enji Cooper
605e9d2105 Fix up r298368
Remove the semicolon accidentally added after the new conditional that tests
that /dev/zero is opened successfully.

MFC after: 1 week
X-MFC with: r298368
Pointhat to: ngie
Reported by: Coverity
CID: 1354980
Sponsored by: EMC / Isilon Storage Division
2016-04-26 19:21:35 +00:00
Enji Cooper
8ad8cdc95f Use sizeof(*uuser) instead of sizeof(struct usm_user) for consistency with
the rest of the users in the file

No functional change

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-04-22 08:11:26 +00:00
Enji Cooper
e9f8d18ebe Return ret in op_ifentry(..) to mute a -Wunused-but-set-variable warning
This will also now detect error conditions with
value->var.subs[sub - 1] == LEAF_ifPhysAddress where `string_get(..)`
could fail if iifp->physaddr and/or iifp->physaddrlen were deemed
invalid.

MFC after: 2 weeks
CID: 1006551
Reported by: Coverity, gcc
Sponsored by: EMC / Isilon Storage Division
2016-04-22 07:51:38 +00:00
Enji Cooper
1422b66c64 Simplify always evaluated branch (e != NULL)
- xalloc(..) ensures that e will be non-null via malloc + err.
- `e` is already dereferenced above, so logically it's impossible
  to hit the lower test without crashing if it was indeed NULL.

MFC after: 3 days
CID: 1007408
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
2016-04-22 05:24:15 +00:00
Enji Cooper
f517a30206 Don't leak string in parse_define(..) when a macro has been found
and the parser token != TOK_ASSIGN

MFC after: 1 week
CID: 1007187, 1007188
Reported by: Coverity
Obtained from: Isilon OneFS (part of r445479)
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2016-04-22 05:14:12 +00:00
Dimitry Andric
b753b98b16 Pull r266775 from upstream clang trunk (by Douglas Katzman):
Pass dwarf-version to cc1as.

  Fix PR26999 - crashing in cc1as with any '*bsd' target.

This should fix possible crashes when using -g in combination with
-save-temps.
2016-04-21 20:38:10 +00:00
Dimitry Andric
f0a19145c0 Revert r298147 (temporary workaround for LLVM PR 26999) in preparation
for committing the final upstream fix.
2016-04-21 20:37:53 +00:00
Enji Cooper
c935e51525 Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c
Ensure opening /dev/zero succeeds. Abort the test if it doesn't.

Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero"

MFC after: 2 weeks
CID: 1251410
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division"
2016-04-20 20:48:54 +00:00
Enji Cooper
4dd13092b5 Fix coverity issues with contrib/netbsd-tests/lib/libc/sys/t_connect.c
- Ensure socket(2) calls succeed
- Don't leak slist allocated by earlier socket(2) call

MFC after: 2 weeks
CID: 976773, 1251405
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
2016-04-20 20:43:05 +00:00
Ed Maste
e5c4075f6b elfcopy: map all !alnum characters to '_' in binary input symbol names
This matches bfd and gold.

Obtained from:	ELF Tool Chain r3445
Sponsored by:	The FreeBSD Foundation
2016-04-20 19:13:00 +00:00
Wojciech Macek
d4015ddc57 Fix KGDB backtrace on ARM
Modify trapframe decoding to properly analyze trapframe.

Provide method for fixup_pc. It happens, that in some kernel
functions, the GDB stack frame decoder cannot determine both
func name and frame size. This is because these functions
either contain invalid instruction, or their format does
not match standard schema. Detect that scenarios and move
PC accordingly to jump into known function schema, which
GDB is able to parse.

Obtained from:         Semihalf
Sponsored by:          Juniper Networks
Reviewed by:           kib, zbb
Differential Revision: https://reviews.freebsd.org/D5976
2016-04-20 17:58:13 +00:00
Xin LI
3e41d09d08 MFV r298178:
Update file to 5.26.

MFC after:	2 weeks
Relnotes:	yes
2016-04-18 07:36:24 +00:00
Baptiste Daroussin
d9f0ce3190 Import libucl 0.8.0 2016-04-17 21:30:40 +00:00
Baptiste Daroussin
d915215ec6 Import sqlite3 3.12.1 2016-04-17 21:23:14 +00:00
Dimitry Andric
0a2e997d7b Until it has been properly fixed upstream, apply a temporary workaround
for LLVM PR 26999 (in some cases, -save-temps can cause an assertion
failure in clang's -cc1as stage).
2016-04-17 15:48:19 +00:00
Glen Barber
8276572f42 Remove the RCSID line from ntp_control.c, and set the fbsd:nokeywords
property.  This should have been done a while back (certainly before
mergeing projects/release-pkg to head), but I fixed the merge conflicts
and forgot to correct the real problem afterward.

Noticed by:	peter
Sponsored by:	The FreeBSD Foundation
2016-04-16 18:10:11 +00:00
Glen Barber
0edd2576c0 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-16 02:32:12 +00:00
Ed Maste
d938d64e55 elfcopy: fix symbol table handling when sections come after symtab/strtab
Fix a symbol table handling bug in elfcopy: elfcopy puts .symtab,
  .strtab and .shstrtab sections in the end of the output object.  If
  the input objects have more sections after any of these 3 sections,
  the section table will be reordered, and in that case the section
  symbols should be regenerated for relocations.

  The bug is triggered since newer clang puts .strtab section in the
  beginning of the object produced.

   Ticket: #525

Reported by:	royger
Obtained from:	ELF Tool Chain r3443
2016-04-15 19:06:36 +00:00
Phil Shafer
42ff34c310 Import to 0.6.1
0.5.0:
    document "trim" modifier
    add xo_emit_field functions
    Add xo_set_file{,_h} functions
    Fix LIBXO_* variables; add -L and -I as needed
    add --disable-silent-rules and an explicit make; s/PACKAGE-NAME/PACKAGE_NAME/; add /download/ to 'url'
    fix silliness where xo_flush_h emitted closing tag (html); make the caller (xo_message) do it
    flush after transitions; fix flush call in xo_do_emit
    mkdir the version-specific packaging dir
    use "XO_" instead of LIBXO_

  0.6.0:
    Add --with-retain-size to set the size (in bits) of the retain hash buckets
    Add The Argument Modifier ({a:})
    Add retain and no-retain to --libxo
    autoconf: Add test for monitor.h
    Document quote heuristic
    go deep with nroff backslashes
    Use "ULL" for 32 bit check
    add xo_retain_clear and xo_retain_clear_all
    docs: combine two 'handles' section; move command line argument section
    handle GETTEXT when msgfmt isn't where it's supposed to be (FreeBSD)
    make 'retain' a flag (XOEF_RETAIN) instead of a role; it's simpler, and doesn't feel as tacky. "{R:}" was painful to document, which means it's painful to use.
    new xo_emit_f functions
    nuke some unused UNUSEDs
    test code: path must be static
    update test cases

  0.6.1:
    fix version number (missed a commit during new-release)

Reviewed by:	sjg
Approved by:	sjg (mentor)
2016-04-15 18:46:15 +00:00
Phil Shafer
a321cc5dc9 import libxo-0.4.7
Fix bug w/ {e:} in html, where no default encoding format was built
    docs: "t" == "trim" (typo) (cf svn commit: r290445 - head/contrib/libxo/libxo)

Reviewed by:	sjg
Approved by:	sjg (mentor)
2016-04-15 15:50:13 +00:00
Cy Schubert
4bb37cd3af Static pointers need not be initialized.
MFC after:	4 weeks
2016-04-15 03:45:09 +00:00
Cy Schubert
ff34412a50 Use NULL instead of 0 for pointer comparison.
MFC after:	4 weeks
2016-04-15 03:43:16 +00:00
Pedro F. Giffuni
ab341f7afd libpcap: fix for simple NULL pointer dereference.
Found with devel/coccinelle.
2016-04-14 18:31:45 +00:00
Glen Barber
9c831bbd69 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-13 02:04:09 +00:00
Phil Shafer
90d30dd1a9 Merge libxo 0.4.6
Reviewed by: sjg
Approved by: sjg (mentor)
2016-04-12 23:30:56 +00:00
Glen Barber
876d357fa7 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-11 15:24:59 +00:00
Enji Cooper
fa2201def5 Disable the NetBSD-specific EFAULT requirements test in gettimeofday_err
FreeBSD doesn't specifically list this as a supported error, and in some
configurations/versions of FreeBSD, this test will segfault as the memory
address might be evaluated in userspace, instead of in kernel space like
in NetBSD.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-04-07 06:21:33 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
Dimitry Andric
faaf0c6eaa Pull in r255683 from upstream libc++ trunk (by Eric Fiselier):
[libcxx] Enable noexcept for GCC 4.6 and greater

  Summary:
  This patch allows GCC 4.6 and above to use `noexcept` as opposed to
  `throw()`.

  Is it an ABI safe change to suddenly switch on `noexcept`? I imagine
  it must be because it's disabled in w/ clang in C++03 but not C++11.

  Reviewers: danalbert, jroelofs, mclow.lists

  Subscribers: cfe-commits

  Differential Revision: http://reviews.llvm.org/D15516

This should fix errors from gcc 4.6 and higher when compiling llvm-cov
and/or other llvm tools.

Reported by:	bdrewery
2016-03-27 21:20:43 +00:00
Dimitry Andric
35b9ea3d09 Compile libcxxrt as C++11, since it is only really used in combination
with libc++, which is also C++11.  Also change one _Static_assert (which
is really C11) back into static_assert, like upstream.

This should help when compiling libcxxrt with newer versions of gcc,
which refuse to recognize any form of static assertions, if not
compiling for C++11 or higher.

While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
headers outside the source tree.
2016-03-27 00:37:54 +00:00
Dimitry Andric
c2145983aa Pull in r264465 from upstream llvm trunk (by David Majnemer):
[X86] Emit a proper ADJCALLSTACKDOWN in EmitLoweredTLSAddr

  We forgot to add the second machine operand to our ADJCALLSTACKDOWN,
  resulting in crashes in PEI.

  This fixes PR27071.

This should fix an assertion failure during buildworld, when using -Os,
and targeting either i386 directly, or building the 32-bit libraries on
amd64.

Reported by:	Eric Camachat <eric.camachat@gmail.com>
2016-03-26 17:38:15 +00:00
Jung-uk Kim
20afc491bb Merge byacc 20160324. 2016-03-25 22:32:26 +00:00
Bryan Drewery
e7e6b1ebc8 Make GCC happy by removing empty #elif.
Sponsored by:	EMC / Isilon Storage Division
2016-03-25 04:16:04 +00:00
Bryan Drewery
8bca825d5d Fix off-by-one found by GCC 5.3.2.
This was fixed during refactoring in the upstream infiniband-diags 1.5.3.

Sponsored by:	EMC / Isilon Storage Division
2016-03-24 21:48:16 +00:00
Dimitry Andric
1d640d3b42 Pull in r264335 from upstream llvm trunk:
Add <atomic> to ThreadPool.h, since std::atomic is used

  Summary:
  Apparently, when compiling with gcc 5.3.2 for powerpc64, the order of
  headers is such that it gets an error about std::atomic<> use in
  ThreadPool.h, since this header is not included explicitly.  See also:

  https://llvm.org/bugs/show_bug.cgi?id=27058

  Fix this by including <atomic>.  Patch by Bryan Drewery.

  Reviewers: chandlerc, joker.eph

  Subscribers: bdrewery, llvm-commits

  Differential Revision: http://reviews.llvm.org/D18460
2016-03-24 20:55:23 +00:00
Ed Maste
676e25ab0f elfcopy: overhaul of LMA handling
Merge ELF Tool Chain r3434:

    Previously, elfcopy defines:

    VMA:  section virtual address
    LMA:  PHDR(p_vaddr)

    While binutils(libbfd) defines:

    VMA:  section virtual address and PHDR(p_vaddr).
    LMA:  PHDR(p_paddr)

    For elfcopy, p_paddr is considered not meaningful and is always set
    to the same value as p_vaddr.

    elfcopy was implemented that way because I thought p_paddr is not
    used/meaningful according to the ELF ABI. However it turned out
    p_paddr is at least used in some ELF files, e.g. the FreeBSD kernel.

    This change made elfcopy treat p_paddr as LMA, same as libbfd.

    (However, some VMA/LMA related command line option still need tweaking
    to make them compatible with binutils objcopy. This will be improved
    later)

    Ticket: #524

And typo fixes in r3435 and r3436.

This fixes the Xen kernel build.

Submitted by:	kaiw
Tested by:	royger
2016-03-24 20:13:17 +00:00
Navdeep Parhar
8d814a458c iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux
iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4.

This commit includes internal changesets 6785 8111 8149 8478 8617 8648
8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730
11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2016-03-21 00:29:45 +00:00
Simon J. Gerraty
3bebe7293b Update to bmake-20160315
Archive member handling works again
meta mode, treat missing reads as for writes.

Update dirdeps.mk - much improved startup time.
Update meta.stage.mk - avoid ln when chmod required.
2016-03-18 20:03:09 +00:00
David E. O'Brien
d20ec2e52b Bring down 0.4.5 vendor files and other catchups with the distribution tarball.
Reviewed by:	phil
2016-03-16 23:59:29 +00:00
Phil Shafer
0263a1a1bc Move generated file from contrib to build directory.
Reviewed by:	obrien
Approved by:	sjg
2016-03-16 23:50:41 +00:00
Gleb Smirnoff
bf840a1707 Redo r294869. The array of counters for TCP states doesn't belong to
struct tcpstat, because the structure can be zeroed out by netstat(1) -z,
and of course running connection counts shouldn't be touched.

Place running connection counts into separate array, and provide
separate read-only sysctl oid for it.
2016-03-15 00:15:10 +00:00
Glen Barber
538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Enji Cooper
45dc13f1ea Better handle filesystems mounted with -o noexec
ftruncate/11, open/20, and truncate/11 copy sleep(1) to a temporary file on the
target filesystem, execute the binary, then expect a result. This doesn't work
with scenarios where the target binary cannot be executed, e.g. the filesystem
was mounted with -o noexec.

Ensure the filesystem hasn't been mounted with -o noexec for the testcases
before executing them.

Differential Revision: https://reviews.freebsd.org/D5622
MFC after: 1 week
Reviewed by: markj
Sponsored by: EMC / Isilon Storage Division
2016-03-12 19:41:38 +00:00
Dimitry Andric
9132599001 Pull in r250279 from upstream libc++ trunk (by Eric Fiselier):
Fix GCC atomic implementation in C++03

Pull in r250802 from upstream libc++ trunk (by Eric Fiselier):

  Detect relaxed constexpr rules for gcc versions

Pull in r255585 from upstream libc++ trunk (by Eric Fiselier):

  Fix various GCC mis-configurations for newer versions.

  This patch goes through and enables C++11 and C++14 features for newer GCC's.
  The main changes are:

  1. Turn on variable templates. (Uses __cpp_variable_templates)
  2. Assert atomic<Tp> is trivially copyable (Uses _GNUC_VER >= 501).
  3. Turn on trailing return support for GCC. (Uses _GNUC_VER >= 404)
  4. XFAIL void_t test for GCC 5.1 and 5.2. Fixed in GCC 6.

Together, these should fix building clang 3.8.0 as part of building
world with recent versions of gcc (e.g. the devel/*-xtoolchain-gcc
ports).
2016-03-11 22:56:16 +00:00
Ed Maste
a87342e849 libelf: correct byte count in cross-endian note translation
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-11 22:37:12 +00:00
Dimitry Andric
163c8ab66f Pull in r246280 from upstream libc++ trunk (by Eric Fiselier):
Fix most GCC warnings during build. Only -Wattribute left.

This helps to fix a number of -Werror warnings when building world with
recent versions of gcc (e.g. the devel/*-xtoolchain-gcc ports).
2016-03-11 20:30:06 +00:00
Ed Maste
1e248b8346 libdwarf: fix SHT_REL relocation processing
Relocation of type SHT_REL must use the current value as addend.

PR:		204084
Obtained from:	NetBSD libdwarf_elf_init.c v1.4
2016-03-11 16:24:39 +00:00
Dag-Erling Smørgrav
a2d0006e29 Apply upstream r3651: the IPv6 address of the L root has changed. 2016-03-11 14:57:40 +00:00
Simon J. Gerraty
be19d90b61 Merge bmake-20160307 2016-03-11 01:35:39 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
30924962f4 Fix and connect setjmp test.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:45:04 +00:00
Glen Barber
b655ec9752 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-06 04:13:17 +00:00
Dimitry Andric
1dcfcfee2a Convert two llvm source files to native line ending, which was also done
upstream.  Merging doesn't automatically do this, unfortunately.
2016-03-05 21:10:34 +00:00
Dimitry Andric
e74e149f78 Upgrade our copies of clang, llvm, lldb and compiler-rt to 3.8.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 will soon be available here:
<http://llvm.org/releases/3.8.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Roman Divacky, Davide Italiano and Antoine Brodin
for their help.

Relnotes:	yes
2016-03-05 20:24:31 +00:00
Dag-Erling Smørgrav
f61ef7f679 Upgrade to Unbound 1.5.8. 2016-03-05 19:29:18 +00:00
Dag-Erling Smørgrav
5bcd892e61 import unbound 1.5.8 2016-03-05 19:18:07 +00:00
Dimitry Andric
a36b180a7f Merge ^/head r296369 through r296409. 2016-03-05 15:34:54 +00:00
Bryan Drewery
be50838f9a DIRDEPS_BUILD: Connect ofed.
Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:44 +00:00
Bryan Drewery
fc064a5e78 Update libsdp to the latest 1.1.108-0.17.ga6958ef.
The only relevant change here is the support for IPv6 in the config
file.  The previous version of this supported IPv6 but not in the
config.  The change for that ended up removing __sdp_sockaddr_to_sdp
which the IPV4 config code required; the IPv6 fix resolved the lack of
that symbol.

Note that the ChangeLog was lacking entries for which we already had the
changes for, which itself was an upstream bug.

Obtained from:	https://www.openfabrics.org/downloads/libsdp/libsdp-1.1.108-0.17.ga6958ef.tar.gz
Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:31 +00:00
Bryan Drewery
1465ae5d7f Fix missing symbol program_invocation_short_name.
This fixes runtime when logging is enabled.

Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:25 +00:00
Bryan Drewery
400b94bbeb Fix over/under-linking in contrib/ofed.
Sponsored by:	EMC / Isilon Storage Division
2016-03-04 22:37:09 +00:00
Ed Maste
f5e9c916af elfcopy: fail if debug link target is empty
An empty debug link target previously returned a confusing and incorrect
error like "objcopy: fread failed: No error: 0". Now, return an explicit
error.

GNU objcopy allows an empty file as the debug link target. However,
that case is nonsensical so diverging from GNU behaviour is fine.

Reviewed by:	bdrewery
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5541
2016-03-04 18:28:19 +00:00
Dimitry Andric
82aa34e6fa Merge ^/head r296007 through r296368. 2016-03-03 23:15:46 +00:00
Dimitry Andric
1b9b7a135c Update llvm and clang to 3.8.0 release. 2016-03-03 22:50:52 +00:00
Pedro F. Giffuni
316e599449 MFV r296350:
Split each domain again after striping any trailing dot.

Reported by:	 dumbbell
Obtained from:	openresolv (53416cf1b4)
2016-03-03 15:36:00 +00:00
Jason Evans
cbc3697dda Restore support for decay time of -1 (no decay). 2016-03-03 01:43:36 +00:00
Jason Evans
cb2ababcfd Add a cast to prevent a compiler warning. 2016-03-03 01:30:28 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Ruslan Bukin
ac8f9de31a Restore configuration for RISC-V. 2016-03-01 17:43:06 +00:00
Jung-uk Kim
0f86d14e9e Merge byacc 20150711. 2016-02-29 21:39:00 +00:00
Jason Evans
df0d881d94 Update jemalloc to 4.1.0.
Add missing Symbol.map entry for __aligned_alloc.

Add weak-->strong symbol binding for
{malloc_stats_print,mallctl,mallctlnametomib,mallctlbymib} -->
{__malloc_stats_print,__mallctl,__mallctlnametomib,__mallctlbymib}.  These
bindings complete the set necessary to allow applications to replace all
malloc-related symbols.
2016-02-29 19:10:32 +00:00
Edward Tomasz Napierala
bb487d2b79 Mark amd(8) and all related utilities as obsolete.
Reviewed by:	wblock@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5443
2016-02-29 16:45:10 +00:00
Pedro F. Giffuni
c364f33426 MFV r296164:
Update openresolve to version 3.7.3 including:

 *  Save the initial working directory and change to it just before
     running any scripts.
     This avoids scripts putting files accidently where they shouldn't.
 *  Strip trailing dot from search and domain names.
 *  man page improvements.

Relnotes:	yes
2016-02-29 14:46:39 +00:00
Mariusz Zaborski
c501d73c7e Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with:		pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by:	drysdale@google.com, bdrewery
Approved by:		pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D4277
2016-02-25 18:23:40 +00:00
Dimitry Andric
09a17a1e45 Update llvm and clang to release_38 branch r261684. 2016-02-24 22:07:56 +00:00
Dimitry Andric
ada6aca3cc Undo r295543, since the shrink wrapping bug was fixed upstream by Davide
Italiano and Quentin Colombet.
2016-02-24 21:41:28 +00:00
Dimitry Andric
14e9c9161c Merge ^/head r295902 through r296006. 2016-02-24 21:38:51 +00:00
Glen Barber
86b234d2f5 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-23 16:01:34 +00:00
Xin LI
876964d12a MFV r295913:
Partially apply upstream changeset 6e06b1c8 (kientzle).

Limit filter recursion level to 25 (instead of infinite).  This fixes a
potential crash issue discovered by Alexander Cherepanov.

PR:		207362
Reported by:	Robert Clausecker
Obtained from:	libarchive github project
2016-02-23 07:13:22 +00:00
Dimitry Andric
76f3831738 Merge ^/head r295845 through r295901. 2016-02-22 22:21:53 +00:00
Dimitry Andric
72e8ce06c0 Fix a problem in ld, causing it to sometimes print messages similar to
"invalid string offset 65521 >= 27261 for section `.strtab'". for object
files produced by recent versions of clang.

In BFD's elf_create_symbuf() function, the size of the symbol buffer
('ssymbuf') is not calculated correctly, and the initial value for the
'ssym' variable is off by one, since 'ssymbuf' has shndx_count + 1
members.

MFC after:	1 week
2016-02-22 22:16:32 +00:00
Glen Barber
317cec3c43 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-22 12:28:23 +00:00
Dimitry Andric
ac1ec6334e Update compiler-rt to release_38 branch r261369. 2016-02-21 16:27:55 +00:00
Dimitry Andric
ce479d84f4 Update llvm and clang to release_38 branch r261369. 2016-02-21 16:23:44 +00:00
Ian Lepore
e1ba387e11 Unconditionally set e_ident[OSABI]=ELFOSABI_FREEBSD in arm binary headers.
When the armv6 support was imported from a project branch, this complex
conditional logic and related #define'd values came along, but it's really
not clear what the intent of it all was.  The effect, however, was that
OSABI was always set to zero, which is "UNIX System V ABI".  Having the wrong
value there causes pkg(8) to avoid looking inside arm elf binaries to
determine shared-lib required/provides info for packaging.
2016-02-21 14:59:24 +00:00
Dimitry Andric
9893f787ec Merge ^/head r295601 through r295844. 2016-02-21 13:49:26 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Ed Maste
3884d6f8bd Allow elfcopy to convert between two non-ELF formats
If the output object is not an ELF file, choose an arbitrary ELF format
for the intermediate file. srec, ihex and binary formats are independent
of class, endianness and machine type so these choices do not affect the
output.

ELF Tool Chain ticket #517

Reviewed by:	kai
Obtained from:	ELF Tool Chain r3411
2016-02-16 14:03:25 +00:00
Glen Barber
0fe0fe112f MFH
Sponsored by:	The FreeBSD Foundation
2016-02-15 21:58:52 +00:00
Dimitry Andric
90a4726375 Merge ^/head r295544 through r295600. 2016-02-13 16:02:12 +00:00
Dimitry Andric
a8bcc4d878 Update llvm, clang and lldb to release_38 branch r260756. 2016-02-13 15:58:51 +00:00
Ed Maste
839529caa9 Update ELF Tool Chain to upstream rev 3400
Some notable improvements include:

readelf:
- Add AArch64 relocation definitions.
- Report value of unknown relocation types.

elfcopy:
- Consider symbols with STB_GNU_UNIQUE binding as global symbols.
- Fixed support for VMA adjustment for loadable sections found
  in relocatable objects.
- Handle nameless global symbols.
- Improve wildcard matching for !-prefixed symbols.
- Add PE/COFF support.

elfdump:
- Improve section type reporting.
- Add MIPS-specific section types.

This update also includes a significant number of bug fixes.

PR:		207091 [exp-run]
Sponsored by:	The FreeBSD Foundation
2016-02-12 20:54:02 +00:00
Dimitry Andric
4156ce4fed Merge ^/head r295351 through r295543. 2016-02-11 20:07:09 +00:00
Dimitry Andric
5529affd65 For now, disable shrink-wrapping (a new optimization pass that computes
the safe point to insert the prologue and epilogue of the function) on
X86.  This prevents problems with some functions using TLS, such as in
jemalloc, and which was the cause for Address Sanitizer crashes.  The
correct fix is still being discussed upstream.
2016-02-11 20:00:22 +00:00
Dag-Erling Smørgrav
0de4f1bf64 Use the new insecure-lan-zones option instead of listing each AS112 zone
separately.

MFC after:	3 days
2016-02-11 17:37:02 +00:00
Glen Barber
bbb51924bb MFH
Sponsored by:	The FreeBSD Foundation
2016-02-08 12:16:01 +00:00
Dimitry Andric
a49d8b6ecc Merge ^/head r294961 through r295350. 2016-02-06 14:07:17 +00:00
Dimitry Andric
f8ca070d3a Merge compiler-rt release_38 branch r258968.
Note that there is still a problem on amd64, causing SIGBUS in the early
startup of Address Sanitizer.  This is being investigated.
2016-02-06 13:39:20 +00:00
Ed Maste
baed4bab22 readelf: decode AArch64 TLS descriptor relocations
From ELF for the ARM(R) 64-bit Architecture, table 4-19.

Obtained from:	ELF Tool Chain r3386
Sponsored by:	The FreeBSD Foundation
2016-02-05 20:57:21 +00:00
Ed Maste
03a5ea47c0 readelf: report value of unknown relocation types
Obtained from:	ELF Tool Chain r3387
Sponsored by:	The FreeBSD Foundation
2016-02-05 20:56:11 +00:00
Ed Maste
23541160bb readelf: avoid accidental fallthrough in RISC-V relocations
This would have printed an unknown RISC-V relocation type as a SPARC
relocation.

CID:		1331398
Obtained from:	ELF Tool Chain r3283
Sponsored by:	The FreeBSD Foundation
2016-02-05 20:54:51 +00:00
Bjoern A. Zeeb
ce42ce038e Try to fix a bug introduced in r228623. We started to copy the ifa_msghdr
as otherwise platforms with strict alignment would break.  It's unclear
to me if there's also a problem with access to the address list following
the structure.  However we never copied the address list after the structure
and thus are pointing at random memory.  For now just use a pointer to the
original memory for accessing the address list making it at least work on
platforms with weak memory access.

PR:			195445
Reported by:		wolfgang lyxys.ka.sub.org
Tested by:		wolfgang lyxys.ka.sub.org (x86)
MFC after:		3 days
2016-02-03 11:03:44 +00:00
Glen Barber
221b349912 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:27:48 +00:00
Pedro F. Giffuni
2d004dd5bc MFV r295109:
Update openresolve to version 3.7.2

Relnotes:	yes
2016-02-02 21:10:43 +00:00
Maxim Sobolev
1d854f3d3e Root out files that don't really belong here and could in fact screw
you over if you happen to use git for FreeBSD development, as it is
the case with the unbound/.gitignore, which lits files that are
actually required for the buildworld.

MFC after:	1 day
2016-02-02 19:04:40 +00:00
Hans Petter Selasky
b340491939 Use LIBADD instead of LDADD.
Sponsored by:	Mellanox Technologies
2016-02-02 11:36:58 +00:00
Enji Cooper
833525a88a Add #include <string.h> to mute warning from clang/gcc about implicitly
declaring strcmp(3)

MFC after: 1 month
Reported by: Jenkins
Sponsored by: EMC / Isilon Storage Division
2016-02-01 07:09:08 +00:00
Glen Barber
c8296cbb96 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-29 14:52:54 +00:00
Dimitry Andric
752d00608c Merge ^/head r294777 through r294960. 2016-01-27 22:52:20 +00:00