Commit Graph

8697 Commits

Author SHA1 Message Date
Dimitry Andric
91019ea7d4 Merge ^/head r358400 through r358465. 2020-02-29 15:08:14 +00:00
Ed Maste
9fdab7a316 remove contrib/gperf
gperf was used only as a build tool for GCC, and is not needed after
r358454.

Sponsored by:	The FreeBSD Foundation
2020-02-29 13:25:38 +00:00
Ed Maste
c45018041d retire the LLVM_LIBUNWIND option
LLVM's libunwind is used on all FreeBSD-supported CPU architectures and
is a required component.

Reviewed by:	brooks (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23123
2020-02-29 12:43:43 +00:00
Ed Maste
a9854bc381 Remove contrib/gcc and contrib/gcclibs
GCC 4.2.1 was disconnected from FreeBSD in r358454.

Sponsored by:	The FreeBSD Foundation
2020-02-29 12:40:27 +00:00
Jung-uk Kim
8c9735fbe0 Plug possible memory leaks in the previous patch.
Two DH_free() calls were accidentally removed.

Pointyhat to:	jkim
2020-02-27 23:06:12 +00:00
Jung-uk Kim
a5f8e6f658 Do not free p and g parameters after calling DH_set0_pqg(3).
It is specifically mentioned in the manual page.  Note it has no functional
change in reality because DH_set0_pqg() cannot fail when both p and g are
not NULL.
2020-02-27 22:36:16 +00:00
Jung-uk Kim
a33b334336 Fix style inconsistencies near our OpenSSL 1.1.x patch. 2020-02-27 22:02:00 +00:00
Jung-uk Kim
3ab9782ad3 Fix a white space. 2020-02-27 20:46:30 +00:00
Brooks Davis
8582cd3101 Merge commit 7214f7a79 from llvm git (by Sam Elliott):
[RISCV] Lower llvm.trap and llvm.debugtrap

  Summary:
  Until this commit, these have lowered to a call to abort().

  `llvm.trap()` now lowers to `unimp`, which should trap on all systems.

  `llvm.debugtrap()` now lowers to `ebreak`, which is exactly what this
  instruction is for.

  Reviewers: asb, luismarques

  Reviewed By: asb

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D69390

This fixes miscompilation resulting in linking failures with
INVARIANTS disabled.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D23857
2020-02-27 20:08:46 +00:00
Hiroki Sato
43092b7d08 Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF.
ftp(1) from vendor/tnftp always tried the following for
every TCP connection:

1. Get the current buffer length of SO_SNDBUF and SO_RCVBUF
   by getsockopt(2).

2. Invoke setsockopt(2) to set them to the same values
   after checking if they are in a range between 8 KiB to 8 MiB.

This behavior broke dynamic buffer sizing enabled by
default (net.inet.tcp.{recv,send}buf_auto sysctls) and
led to a very poor transfer rate.  The fetch(1) utility
does not have this problem.

This change prevents SO_SNDBUF and SO_RCVBUF from configuring
when the buffer auto-sizing is enabled unless the buffer sizes are
explicitly specified.

PR:		240827
Spotted by:	Yuichiro NAITO
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23732
2020-02-27 19:49:59 +00:00
Hiroki Sato
9b429e2192 Fix broken STARTTLS when SharedMemoryKey is enabled.
OpenSSL 1.1 API patch for sendmail had a bug which
prevented sm_RSA_generate_key() function from working.
This function is used to generate a temporary RSA key
for a shared memory region used for TLS processing.
Note that 12.0 and 12.1-RELEASE include this bug.

This affects only if SM_CONF_SHM compile-time
option (enabled by default) and SharedMemoryKey
run-time option (not enabled by default) in a .cf file are
specified.  The latter corresponds to confSHARED_MEMORY_KEY in
a .mc file.

PR:		242861
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D23734
2020-02-27 19:40:29 +00:00
Dimitry Andric
4739579419 Merge ^/vendor/llvm-project/release-10.x up to its last change (upstream
commit llvmorg-10.0.0-rc2-70-ge5cb70267e7), and bump versions.
2020-02-27 19:04:39 +00:00
Dimitry Andric
21054a9b07 Merge commit 2e24219d3 from llvm git (by Hans Wennborg):
[MC][ARM] Resolve some pcrel fixups at assembly time (PR44929)

  MC currently does not emit these relocation types, and lld does not
  handle them. Add FKF_Constant as a work-around of some ARM code after
  D72197. Eventually we probably should implement these relocation
  types.

  By Fangrui Song!

  Differential revision: https://reviews.llvm.org/D72892

This re-enables using the arm 'adr' pseudo instruction on global symbols
again.  It was broken as a side-effect of upstream commit 2bfee35cb,
which lead to "error: unsupported relocation on symbol" when assembling
such constructs, which are used in e.g. sys/arm/arm/locore-v[46].S.

PR:		244251
2020-02-27 18:49:49 +00:00
Dimitry Andric
43c7dd6b59 Merge ^/head r358075 through r358130. 2020-02-19 21:03:06 +00:00
Baptiste Daroussin
e18651243e Update to 6.2-20200215
While I didn't plan another upgrade, This version incorporate fixes from
kevans@ so let's upgrade to it
2020-02-19 17:09:08 +00:00
Dimitry Andric
abaad9d77d Merge ^/head r358049 through r358074. 2020-02-18 17:59:37 +00:00
Cy Schubert
9658b6b3f4 As with ipf(8), give ippool(8) the ability to load IP pools from multiple
files. This allows for loading, during the same invocation of ippool, of
multiple sources of input using multiple tools to concurrently maintain the
files such as fail2ban, macro preprocessors, and manually.

MFC after:	1 week
2020-02-18 11:26:49 +00:00
Baptiste Daroussin
aae38d10b4 Update ncurses to 20200118
Among the changes from before:
- Add support for extended colors on widechar version
- Enable ncurses extended functions
- Enable version 2 of the extended mouse support
- Enable SCREEN extensions

Modification that differs from upstream:
- _nc_delink_entries used to be exposed and was turn static,
  turn it back as dynamic to not break abi
- Adapt our old termcap.c to modern ncurses

MFC after:	3 weeks
2020-02-18 08:11:52 +00:00
Dimitry Andric
3c4ad300a1 Merge ^/head r358000 through r358048. 2020-02-17 20:27:05 +00:00
Li-Wen Hsu
80986ae0c1 Really skip the tests in capsicum tests
Sponsored by:	The FreeBSD Foundation
2020-02-17 20:25:33 +00:00
Li-Wen Hsu
30fd7f5487 Temporarily skip flakey test in sys.capsicum.capsicum-test.main:
PipePdfork.WildcardWait

PR:		244165
Sponsored by:	The FreeBSD Foundation
2020-02-16 14:33:55 +00:00
Dimitry Andric
46bc58a0ff Merge commit 62654cab7 from llvm git (by me):
Restore functionality of --sysroot on FreeBSD after b18cb9c47

  After b18cb9c47, clang would sometimes prefer the host C++ includes
  (e.g. in /usr/include/c++/v1) before those specified via --sysroot.
  While this behavior may be desirable on Linux, it is not so on
  FreeBSD, where we make extensive use of --sysroot during the build of
  the base system.  In that case, clang must *not* search outside the
  sysroot, except for its own internal headers.

  Add an override addLibCxxIncludePaths() to restore the old behavior,
  which is to simply append /usr/include/c++/v1 to the specified
  sysroot.  While here, apply clang-format to the FreeBSD specific
  toolchain files.

  Fixes PR44923.
2020-02-16 13:22:36 +00:00
Dimitry Andric
473b61d31e Merge commit 221c5af4e from llvm git (by Nico Weber):
Fix a -Wbitwise-conditional-parentheses warning in
  _LIBUNWIND_ARM_EHABI libunwind builds

  ```
  src/UnwindCursor.hpp:1344:51: error: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses]
    _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0;  // Use enum?
					~~~~~~~~~~~ ^
  src/UnwindCursor.hpp:1344:51: note: place parentheses around the '|' expression to silence this warning
    _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0;  // Use enum?
						    ^
					(          )
  src/UnwindCursor.hpp:1344:51: note: place parentheses around the '?:' expression to evaluate it first
    _info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0;  // Use enum?
						    ^
					    (                )
  ```

  But `0 |` is a no-op for either of those two interpretations, so I
  think what was meant here was

  ```
    _info.flags = (isSingleWordEHT ? 1 : 0) | (scope32 ? 0x2 : 0);  // Use enum?
  ```

  Previously, if `isSingleWordEHT` was set, bit 2 would never be set.
  Now it is. From what I can tell, the only thing that checks these
  bitmask is ProcessDescriptors in Unwind-EHABI.cpp, and that only
  cares about bit 1, so in practice this shouldn't have much of an
  effect.

  Differential Revision: https://reviews.llvm.org/D73890

This fixes the above errors when building libunwind for arm variants.
2020-02-15 15:03:26 +00:00
Dimitry Andric
13138422bc Merge ^/vendor/llvm-project/release-10.x up to its last change (upstream
commit llvmorg-10.0.0-rc2-0-g90c78073f73), bump versions, and update
build glue.
2020-02-15 14:58:40 +00:00
Dimitry Andric
74dc6beb30 Merge ^/head r357855 through r357920. 2020-02-14 19:32:58 +00:00
Kyle Evans
d8b7b73571 ncurses: correct check for gcc >= 5.0
The hack in question is intended to workaround seemingly bogus #line markers
in cpp output. As far as I can tell, llvm cpp doesn't do this by default, so
there's no reason to add -P.

In our /bin/sh, the main incantation should be placed in a sub-shell in
order to properly pipe the output to fgrep.

The main motivation for this change is admittedly to stop emitting the noise
about clang not being gcc in make -s buildworld

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D22952
2020-02-14 04:16:22 +00:00
Ed Maste
fe91dd0138 addr2line: use stdbool.h header for bool
Presumably a bool definition is obtained via header contamination on
FreeBSD-CURRENT.  Found while trying to upstream FreeBSD addr2line
changes - the FreeBSD 11.2 CI build failed there.

Reported by:	Cirrus-CI, upstream ELF Tool Chain
MFC with:	r357844
Sponsored by:	The FreeBSD Foundation
2020-02-13 16:17:05 +00:00
Dimitry Andric
44e86fbdcf Merge ^/head r357662 through r357854. 2020-02-13 12:52:24 +00:00
Ed Maste
6c4a4f1bc2 addr2line: Handle DW_AT_ranges in compile units
Based on original submission by Marat Radchenko in ELF Tool Chain
ticket #545, rebased and updated by Tiger Gao.

PR:		217736
Submitted by:	Marat Radchenko <marat@slonopotamus.org>
Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23501
2020-02-12 21:52:10 +00:00
Ed Maste
57d7e4cc2c elfcopy: set ELF OS/ABI field when converting from binary
PR:		228934
Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
Reviewed by:	markj, jkoshy
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23504
2020-02-12 15:59:59 +00:00
Martin Matuska
f976241773 MFV r357783:
Update libarchive to 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

X-MFC-With:	r356212,r356365,r356416
MFC after:	1 week
2020-02-12 00:16:56 +00:00
Martin Matuska
8185c4ae24 Update vendor/libarchive/dist to git 3288ebb0353beb51dfb09d444dedbe9235ead53d
Libarchive 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()
2020-02-11 23:48:03 +00:00
Xin LI
d38c30c092 MFV r357712: file 5.38.
MFC after:	2 weeks
2020-02-11 07:02:48 +00:00
Kyle Evans
850e0825a2 MFV r357687: Import NFS fix for O_SEARCH tests
The version that ended upstream was ultimately slightly different than the
version committed here; notably, statvfs() is used but it's redefined
appropriately to statfs() on FreeBSD since we don't provide the fstypename
for the former interface.
2020-02-09 04:05:30 +00:00
Kyle Evans
14d3b06919 O_SEARCH test: mark revokex an expected fail on NFS
The revokex test does not work when the scratch directory is created on NFS.
Given the nature of NFS, it likely can never work without looking like a
security hole since O_SEARCH would rely on the server knowing that the
directory did have +x at the time of open and that it's OK for it to have
been revoked based on POSIX specification for O_SEARCH.

This does mean that O_SEARCH is only partially functional on NFS in general,
but I suspect the execute bit getting revoked in the process is likely not
common.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23573
2020-02-07 22:36:37 +00:00
Dimitry Andric
bc02c18c48 Merge ^/head r357408 through r357661. 2020-02-07 19:08:37 +00:00
Kyle Evans
7295d1dda1 MFV r357635: imnport v1.9 of the O_SEARCH tests
The RCSID data was wrong, so this is effectively a record-only merge
with correction of said data. No further changes should be needed in this
area, as we've now upstreamed our local changes to this specific test.
2020-02-06 18:51:36 +00:00
Xin LI
f99e4a2d11 MFV r357608: Limit memory usage in xz(1) instead of in tuklib.
Apply upstream 353970510895f6a80adfe60cf71b70a95adfa8bc to limit memory
usage on 32-bit binary to 4020 MiB.

Submitted by:	Lasse Collin <lasse.collin at tukaani.org>
Reviewed by:	kib, bcr
Differential Revision:	https://reviews.freebsd.org/D23474
2020-02-06 07:47:28 +00:00
Kyle Evans
28e68bc000 O_SEARCH test: drop O_SEARCH|O_RDWR local diff
In FreeBSD's O_SEARCH implementation, O_SEARCH in conjunction with O_RDWR or
O_WRONLY is explicitly rejected. In this case, O_RDWR was not necessary
anyways as the file will get created with or without it.

This was submitted upstream as misc/54940 and committed in rev 1.8 of the
file.
2020-02-05 17:21:36 +00:00
Kyle Evans
56cc8b7595 O_SEARCH tests: plug trivial fd leak
Coverity correctly reports this as a resource leak. It's an admittedly minor
one, but plug it anyways.

This has been submitted upstream as misc/54939.

CID:		978288
2020-02-05 02:30:46 +00:00
Mark Johnston
85642eee46 readelf: Don't leak memory when dwarf_get_fde_info_for_all_regs() fails.
CID:		1292493
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:18:56 +00:00
Mark Johnston
37fa1df2d1 readelf: Fix the check for an error from realloc().
Use err() instead of errx() while here, since realloc() sets errno.

CID:		1401326
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:18:37 +00:00
Mark Johnston
dfa169049b readelf: Fix a double close of the input file.
The caller of dump_object() is responsible for opening the file, let it
be responsible for closing too.

CID:		1411588
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:18:16 +00:00
Mark Johnston
b7fc41b3ca size: Avoid returning a stack pointer from xlatetom().
The callers only check whether the returned pointer is non-NULL, so this
was harmless in practice, but change the return value to guard against
the issue.

CID:		1411597
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:17:59 +00:00
Mark Johnston
640ff6ed84 elfcopy: Avoid leaking dst's fd when we fail to copy a file.
We should really create the output file in the same directory as the
destination file so that rename() works.  This will be done in a future
change as part of some work to run in capability mode.

CID:		1262523
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:16:56 +00:00
Mark Johnston
f2530c80db elfcopy: Handle multiple data descriptors properly.
The code clearly meant to resize the buffer in the case where a section
was backed by multiple data descriptors.

In practice this shouldn't have been a problem since libelf would return
a single data descriptor for each section in a newly opened file.

CID:		1262522
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:16:41 +00:00
Mark Johnston
334f09a65b libelftc: Add a missing check for an error from vector_str_init().
While here consistently use the same spelling for such checks.

CID:		1376769
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:16:16 +00:00
Mark Johnston
a3c35da61b libelftc: Fix memory leaks in the C++ demanglers.
CID:		1262518, 1262519, 1262520, 1262529
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:15:52 +00:00
Mark Johnston
ab3b51df28 libdwarf: Fix a memory leak in _dwarf_frame_section_init().
If frame length validation failed we would leak memory.

CID:		1193366
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:15:29 +00:00
Mark Johnston
513e76aaf8 libdwarf: Make an out-pointer of _dwarf_abbrev_add() mandatory.
All callers pass a non-NULL pointer, and otherwise it was possible to
leak memory if the abbrev was not added to a CU.

CID:		1193365
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-02-04 21:15:11 +00:00