Commit Graph

5156 Commits

Author SHA1 Message Date
Xin LI
f5f47d5068 Remove a few files that are not needed for FreeBSD.
PR:		bin/171555
Approved by:	obrien
2012-09-11 21:16:22 +00:00
Gregory Neil Shapiro
0d3a0b40cd Properly define true/false when defining __bool_true_false_are_defined
for filters which pull in mfapi.h before stdbool.h.  Issue reported by
Petr Rehor, maintainer of amavisd-milter port.

MFC after:	3 days
2012-09-10 01:15:51 +00:00
Gleb Smirnoff
f2ddd22eac For UDP transport set IP_RECVDSTADDR sockopt on the socket, and provide
IP_SENDSRCADDR control with datagram message we reply with. This makes
bsnmpd reply from exactly same address that request was sent to, thus
successfully bypassing stateful firewalls or other kinds of strict checking.

PR:		bin/171279
2012-09-09 09:46:48 +00:00
Gleb Smirnoff
0cf0d912b7 The first part of check_priv() function, that attempts to obtain creds
from the control message, actually never worked. This means check_priv()
didn't work for local dgram sockets.

The SCM_CREDS control messages is received only in two cases:

1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case
   the message is struct sockcred.
2) If sender did supplied SCM_CREDS control message in his sendmsg()
   syscall. In this case the message is struct cmsgcred.

We can't rely on 2), so we will use 1) for dgram sockets. For stream
sockets it is more reliable to obtain accept-time credentials, since
SCM_CREDS control message is attached only on first read. Thus:

o Do setsockopt(LOCAL_CREDS) on local dgram sockets.
o Split check_priv() into check_priv_stream() and check_priv_dgram(),
  and call them from recv_stream() and recv_dgram() respectively.
o Don't provide space for SCM_CREDS control message in recv_stream().
o Provide space for SCM_CREDS control message in recv_dgram(), but there
  is no need to initialize anything in it.
o In recv_dgram() do not blindly expect that first message is SCM_CREDS,
  instead use correct search cycle through control messages.
2012-09-08 07:12:00 +00:00
Gleb Smirnoff
d6d3f01e0a Merge the projects/pf/head branch, that was worked on for last six months,
into head. The most significant achievements in the new code:

 o Fine grained locking, thus much better performance.
 o Fixes to many problems in pf, that were specific to FreeBSD port.

New code doesn't have that many ifdefs and much less OpenBSDisms, thus
is more attractive to our developers.

  Those interested in details, can browse through SVN log of the
projects/pf/head branch. And for reference, here is exact list of
revisions merged:

r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330,
r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656,
r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782,
r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868,
r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223,
r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456,
r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505,
r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168,
r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230,
r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398,
r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548,
r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672,
r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169,
r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442,
r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522,
r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661,
r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212.

I'd like to thank people who participated in early testing:

Tested by:	Florian Smeets <flo freebsd.org>
Tested by:	Chekaluk Vitaly <artemrts ukr.net>
Tested by:	Ben Wilber <ben desync.com>
Tested by:	Ian FREISLICH <ianf cloudseed.co.za>
2012-09-08 06:41:54 +00:00
Kevin Lo
31f7ba0295 Fully initialize the stack-allocated "struct sockaddr_in sa" structure. 2012-09-07 08:58:30 +00:00
Ed Maste
448ba34319 Fix "Corrupted DWARF expression" from (k)gdb.
Google turned up Debian bug 405116, which describes the problem in
sufficient detail to identify the overflowing variables.

MFC after:	1 week
2012-09-06 13:47:42 +00:00
Marcel Moolenaar
b514734386 Update to a pruned 0.16. 2012-09-05 16:01:08 +00:00
Marcel Moolenaar
451f0851c2 Add headers created by running configure. 2012-09-04 23:27:07 +00:00
Marcel Moolenaar
c243e4902b Merge ATF 0.16 from vendor/atf/dist.
Provenance: http://code.google.com/p/kyua
Discussed with: gibbs, gnn, keramida, mdf, mlaier,
Discussed with: Garrett Cooper
2012-09-04 23:16:58 +00:00
Andrew Turner
f1f92378c1 Fix a logic inversion in an assert to allow us to use dts files that
include other files.
2012-09-02 01:48:47 +00:00
Dimitry Andric
6a1fba3556 Fix a twelve year old bug in readelf: when process_dynamic_segment()
encounters a DT_RUNPATH entry, the global dynamic_info[] array is
overrun, causing some other global variable to be overwritten.

In my testcase, this was the section_headers variable, leading to
segfaults or jemalloc assertions when it was freed later on.

Thanks to Koop Mast for providing samples of a few "bad" .so files.

MFC after:	1 week
2012-08-31 23:28:41 +00:00
Dimitry Andric
ff3657eeaf Teach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't
error out on files that contain it.  (This attribute can be emitted by
newer versions of clang.)

MFC after:	2 weeks
2012-08-29 18:37:10 +00:00
Martin Matuska
7ceb94332b Apply fix for vendor pull request #17:
Support appending to empty archives

References:
  https://github.com/libarchive/libarchive/pull/17

Submitted by:	myself
Obtained from:	libarchive master branch on github
2012-08-23 19:40:28 +00:00
Dimitry Andric
3ed7dc5f46 Pull in r162360 from upstream clang trunk:
Merge existing attributes before processing pragmas in friend template
  declarations.
  Fixes pr13662.

This should help when building Firefox with libc++.
2012-08-23 18:14:59 +00:00
Dimitry Andric
5948d40700 Since our clang now supports the tls_model attribute, remove the
workaround for it in jemalloc_FreeBSD.h.

Reviewed by:	jasone
2012-08-23 17:58:22 +00:00
Andrey A. Chernov
27c9070e7e According to resolvconf.conf(5) manpage and sources, there is no
'nameservers' option which used in examples in resolvconf.conf(5),
it spelled 'name_servers', so fix examples.
2012-08-21 06:14:08 +00:00
Dimitry Andric
7ae0e2c9f0 Upgrade our copy of llvm/clang to trunk r162107. With thanks to
Benjamin Kramer and Joerg Sonnenberger for their input and fixes.
2012-08-20 18:33:03 +00:00
David E. O'Brien
6f5e32433e Catch up with the subversion conversion and apply these build-time patches. 2012-08-17 18:20:38 +00:00
Stephen McKay
a0ebde2020 Correct a regression introduced during the import of file(1) 5.11.
Magic tests containing "search" or "regex" directives were incorrectly
compiled by "mkmagic" and were effectively ignored.  This caused troff
files (for example) to be detected as simply "ASCII text" instead of
as "troff or preprocessor input, ASCII text".

PR:		bin/170415
Approved by:	consensus on developers@
MFC after:	3 days
2012-08-17 02:27:17 +00:00
Oleksandr Tymoshenko
4da573d910 Merging of projects/armv6, part 3
r238211:
Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb

This adds a new TARGET_ARCH for building on ARM
processors that support the ARMv6K multiprocessor
extensions.  In particular, these processors have
better support for TLS and mutex operations.

This mostly touches a lot of Makefiles to extend
existing patterns for inferring CPUARCH from ARCH.
It also configures:
 * GCC to default to arm1176jz-s
 * GCC to predefine __FreeBSD_ARCH_armv6__
 * gas to default to ARM_ARCH_V6K
 * uname -p to return 'armv6'
 * make so that MACHINE_ARCH defaults to 'armv6'
It also changes a number of headers to use
the compiler __ARM_ARCH_XXX__ macros to configure
processor-specific support routines.

Submitted by:	Tim Kientzle <kientzle@freebsd.org>
2012-08-15 03:21:56 +00:00
Xin LI
9776cb63ad RFC 2289 requires all hashes be stored in little endian format before
folding to 64 bits, while SHA1 code is big endian.  Therefore, a bswap32
is required before using the value.

Without this change, the implementation does not conform to test vector
found in RFC 2289.

PR:		bin/170519
Submitted by:	Arthur Mesh <arthurmesh gmail com> (with changes)
MFC after:	1 week
2012-08-10 04:48:58 +00:00
Andrew Turner
fdc8ba5e71 Import compiler-rt r160957.
This is mostly a no-op other than for ARM where it adds missing
__aeabi_mem* and __aeabi_*divmod functions. Even on ARM these will remain
unused until the rest of the ARM EABI code is merged.
2012-08-08 09:42:44 +00:00
Martin Matuska
10ed66fdf8 Backport NFSv4 ACL fix from libarchive master branch.
Source:
https://github.com/libarchive/libarchive/commit/f67370d5

Obtained from:	libarchive (master branch)
2012-07-30 14:47:35 +00:00
Martin Matuska
88b860fc7a Fix endless loop if reading unsupported ACL type.
Apply fix from vendor's master branch.

References:
https://github.com/libarchive/libarchive/commit/d8b9dbd

Reported on:	freebsd-current@
Obtained from:	libarchive
2012-07-29 06:33:27 +00:00
Dimitry Andric
e07d856055 Similar to what is already done for Linux, make clang not complain about
unused -g, -emit-llvm or -w arguments when doing linking.  E.g. invoking
"clang -g foo.o -o foo" will now be silent.

Reported by:	Jakub Lach <jakub_lach@mailplus.pl>
MFC after:	1 week
2012-07-28 13:12:57 +00:00
Dimitry Andric
38bce0dde0 Similar to r238472, let clang pass --enable-new-dtags to the linker
invocation by default.  Also make sure --hash-style=both is passed for
the same arches as gcc, e.g. arm, sparc and x86.

X-MFC-with:	r238472
2012-07-28 12:50:25 +00:00
Martin Matuska
fd082e96c4 Update libarchive to 3.0.4 2012-07-28 06:38:44 +00:00
Martin Matuska
48cbf1ba5b Update information on obtaining libarchive sources and FreeBSD-Xlist 2012-07-27 08:28:44 +00:00
Ruslan Ermilov
ca0a2184d6 Pull up vendor changes to mdoc(7). 2012-07-26 11:12:38 +00:00
Ruslan Ermilov
a16720da65 Backed out r228904, and added libstdthreads support to mdoc(7) to where
it belongs.
2012-07-26 11:10:25 +00:00
Ruslan Ermilov
770b69c0b7 Backed out r236255, and added FreeBSD 9.1 support to mdoc(7) to where
it belongs.
2012-07-26 10:58:30 +00:00
Warner Losh
6c889456a8 Preen unused Makefiles, programs and ftdump.c which has been renamed
to fdtdump.c in the upstream repo.  This escaped my attention in the
import.
2012-07-25 06:04:38 +00:00
Doug Barton
dae131adad Heavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure
in BIND9

High numbers of queries with DNSSEC validation enabled can cause an
assertion failure in named, caused by using a "bad cache" data structure
before it has been initialized.

CVE: CVE-2012-3817
Posting date: 24 July, 2012
2012-07-24 18:53:28 +00:00
Warner Losh
52baf267be Update to latest git version of dtc to get new dtsv2 support,
including the include directive.

Fix minor build issue corrected by converting yypush_buffer_state and
yypop_buffer_state to yy_set_buffer_state and a hard-coded 100-deep
stack.  It was easier to fix it here than to import that support into
our flex.

The new tools and test hardness remain unsupported at the moment.
2012-07-24 16:29:33 +00:00
Xin LI
e24497193b MFV: less v451. 2012-07-24 01:09:11 +00:00
Konstantin Belousov
b375a6d71d Pass --enable-new-dtags to the linker invocation by default. If
desired, one can turn off the generation of post-ELF standard dtags by
overriding it with --disable-new-dtags after the default switch.

Immediate effect of the change is that -rpath path is now stored both
in DT_RPATH and DT_RUNPATH tags, which is the right way to provide
rpath for dynamic linker supporting DT_RUNPATH per specification.

Reviewed by:	kan
MFC after:	1 month
2012-07-15 10:54:10 +00:00
Dimitry Andric
f8079271e6 Pull in r159895 from upstream clang trunk:
When marking virtual functions as used for a class' vtable, mark all functions
  which will appear in the vtable as used, not just those ones which were
  declared within the class itself. Fixes an issue reported as comment#3 in
  PR12763 -- we sometimes assert in codegen if we try to emit a reference to a
  function declaration which we've not marked as referenced. This also matches
  gcc's observed behavior.

This should fix clang assertions when building certain components of the
LibreOffice port.

MFC after:	3 days
2012-07-13 21:48:01 +00:00
John Baldwin
11a08d62da Add support for the 'invept' and 'invvpid' instructions. Beyond simply
adding appropriate table entries, the assembler had to be adjusted as
these are the first non-SSE instructions to use a 3-byte opcode (and a
mandatory prefix to boot).

MFC after:	1 month
2012-07-06 14:28:18 +00:00
John Baldwin
22f9e86238 Add support for the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', and 'xsetbv'
instructions.  I reimplemented this from scratch based on the Intel
manuals and the existing support for handling the fxsave and fxrstor
instructions.  This will let us use these instructions natively with GCC
rather than hardcoding the opcodes in hex.

Reviewed by:	kib
MFC after:	1 month
2012-07-04 22:12:10 +00:00
John Baldwin
2e52fb92ff Add a new line to top that provides a brief summary of the ZFS ARC memory
usage on hosts using ZFS.  The new line displays the total amount of RAM
used by the ARC along with the size of MFU, MRU, anonymous (in flight),
headers, and other (miscellaneous) sub-categories.  The line is not
displayed on systems that are not using ZFS.

Reviewed by:	avg, fs@
MFC after:	3 days
2012-06-27 18:08:48 +00:00
Joel Dahl
49074c51cc mdocify and update the traceroute(8) manual page.
Reviewed by:	brueffer
No objection:	ru, uqs
2012-06-27 07:41:21 +00:00
Xin LI
96e55cc72d MFV: less v449. 2012-06-26 23:17:33 +00:00
Pedro F. Giffuni
5917560e17 Bring a couple of fixes for gcc optimizations.
The GCC4.3 branch contains some optimization fixes
that were not considered regressions and therefore
were never backported. We are bringing a couple of
them that are under GPLv2 since they were made
before the license switch upstream.

While here, add the GCC revision numbers in the
log.

Discussed with: jkim
MFC after:	1 week
2012-06-21 16:49:20 +00:00
Joel Dahl
bef04523e3 Remove end of line whitespace. 2012-06-17 11:36:28 +00:00
Joel Dahl
0aa9c2d892 Minor mdoc fixes. 2012-06-17 11:33:55 +00:00
Joel Dahl
5febe54f25 Remove superfluous paragraph macro. 2012-06-17 11:04:38 +00:00
Marius Strobl
d2a3fae7ec Merge r236137 from x86:
Enable GNU hash generation for dynamic ELF binaries.
2012-06-14 20:29:49 +00:00
Pedro F. Giffuni
a6c34d9e26 Revert r236962 - Experimental amdfam10/barcelona support.
The patches are unexpectedly causing gcc to fail while
building ports/graphics/ImageMagick even when the cpu
flags are not used.

Reported by:	Andreas Tobler
2012-06-13 20:21:08 +00:00
Pedro F. Giffuni
d3d19ef9c2 Space mismatch - typo in r236962.
Found by:	Dima Panov
Approved by:	jhb (mentor)
MFC after:	2 weeks
2012-06-12 16:07:03 +00:00