cy [Sat, 11 Feb 2017 18:10:55 +0000 (18:10 +0000)]
MFC r311950 (by bz):
Get rid of a compiler warning which I saw too often.
Include netinet/in.h before ip_compat.t which will then check if
IPPROTO_IPIP is defined or not. Doing it the other way round,
ip_compat.h would not find it defined and netinet/in.h then
redefine it.
mm [Sat, 11 Feb 2017 00:56:18 +0000 (00:56 +0000)]
MFC r310866,310868,310870,311903,313074:
Sync libarchive with vendor.
MFC r310866:
PR #771: Add NFSv4 ACL support to pax and restricted pax
NFSv4 ACL information may now be stored to and restored from tar archives.
ACL must be non-trivial and supported by the underlying filesystem, e.g.
natively by ZFS or by UFS with the NFSv4 ACL enable flag set.
MFC r310868:
PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c
PR #851: Spelling fixes
Fix two protoypes in manual page archive_read_disk.3
MFC r310870:
Use __LA_DEPRECATED macro with functions deprecated in 379867e
MFC r311903:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes
Multiple fixes in ACL code:
- prefer acl_set_fd_np() to acl_set_fd()
- if acl_set_fd_np() fails, do no fallback to acl_set_file()
- do not warn if trying to write ACLs to a filesystem without ACL support
- fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs
MFC r313074:
- support extracting NFSv4 ACLs from Solaris tar archives
- bugfixes and optimizations in the ACL code
- multiple fixes in the test suite
- typo and other small bugfixes
Security fixes:
- cab reader: endless loop when parsing MSZIP signature (OSS-Fuzz 335)
- LHA reader: heap-buffer-overflow in lha_read_file_header_1()
(CVE-2017-5601)
- LZ4 reader: null-pointer dereference in lz4_filter_read_legacy_stream()
(OSS-Fuzz 453)
- mtree reader: heap-buffer-overflow in detect_form() (OSS-Fuzz 421, 443)
- WARC reader: heap-buffer-overflow in xstrpisotime() (OSS-Fuzz 382, 458)
Memory leak fixes:
- ACL support: free memory allocated by acl_get_qualifier()
- disk writer: missing free in create_filesystem_object()
- file reader: fd leak (Coverity 1016755)
- gnutar writer: fix free in archive_write_gnutar_header()
(Coverity 101675)
- iso 9660 reader: missing free in parse_file_info()
(partial Coverity 1016754)
- program reader: missing free in __archive_read_program()
- program writer: missing free in __archive_write_program_free()
- xar reader: missing free in xar_cleanup()
- xar reader: missing frees in expat_xmlattr_setup()
(Coverity 1229979-1229981)
- xar writer: missing free in file_free()
- zip reader: missing free in zip_read_local_file_header()
List of all libarchive issues at OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/list?can=1&q=libarchive
vangyzen [Fri, 10 Feb 2017 16:11:11 +0000 (16:11 +0000)]
MFC r313401
Fix garbage IP addresses in UDP log_in_vain messages
If multiple threads emit a UDP log_in_vain message concurrently,
or indeed call inet_ntoa() for any other reason,
the IP addresses could be garbage due to concurrent usage of a
single string buffer inside inet_ntoa(). Use inet_ntoa_r() with
two stack buffers instead.
ngie [Fri, 10 Feb 2017 04:28:44 +0000 (04:28 +0000)]
MFC r286536:
This unbreaks "make installworld" for me on ^/stable/10
r286536 (by imp):
cmp and cp are used by the kerberos install, so need to be imclided in
ITOOLS. They are tiny enough that I'm not making conditional: the
minuscule savings in disk space isn't worth the obfuscation of
Makefile.inc1.
ngie [Fri, 10 Feb 2017 03:22:00 +0000 (03:22 +0000)]
MFC r311233,r311377:
r311233:
Fix Coverity issues
- Initialize .sun_len before passing it to strlcpy and bind.
- Close fd on error
CID: 978283, 979581
r311377:
Redo fix for CID 979581
The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].
SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.
ngie [Fri, 10 Feb 2017 03:04:42 +0000 (03:04 +0000)]
MFC r309774,r309778,r309779,r309780:
r309774:
Only run mdconfig -d -u 3 if /dev/md3 exists on the system
This will prevent "cleanup failures" (exit code != 0 returned) when
tmpfs is not loaded
r309778:
Make test_unmount usable in cleanup subroutines
- Duplicate test_unmount to _test_unmount
- Remove atf_check calls
- Call _test_unmount from test_unmount, checking the exit code
at the end, and returning it to maintain the test_unmount
"contract"
r309779:
- Ignore errors from umount
- Use _test_unmount instead of test_unmount in cleanup
r309780:
Use _test_unmount instead of test_unmount in cleanup to avoid
false positives with atf_check when tmpfs is not loaded, etc
ngie [Fri, 10 Feb 2017 02:57:37 +0000 (02:57 +0000)]
MFC r309373:
r309373 (by bdrewery):
Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired.
This uses the same fix as r294894 did for the mlock test. The code from
that commit is moved into a common object file which PROGS supports
building first.
ngie [Fri, 10 Feb 2017 02:51:53 +0000 (02:51 +0000)]
MFC r307190,r307196,r307204,r307205:
r307190:
Skip :uchg on FreeBSD
Unfortunately removing files with uchg set always succeeds with root on
FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
because mounting tmpfs requires root
PR: 212861
r307196:
Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD
- Add inttypes.h #include for PRId64 macro
- Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
fhandle_t, unlike NetBSD's copy of fhp, which is void*.
r307204:
Expect :large to fail on FreeBSD
FreeBSD doesn't appear to validate large -o size values like
NetBSD does
PR: 212862
r307205:
Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected
ngie [Fri, 10 Feb 2017 02:41:33 +0000 (02:41 +0000)]
MFC r301753:
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.
ngie [Fri, 10 Feb 2017 02:37:42 +0000 (02:37 +0000)]
MFC r288444:
This change has no functional impact on ^/stable/10 because arm64 isn't
supported on 10.x, but it is being done to ease additional backports in
this test
r288444 (by andrew):
Pass 8 arguments to makecontext on arm64 as this is all we support.
ngie [Fri, 10 Feb 2017 02:21:57 +0000 (02:21 +0000)]
MFC r304797,r305467:
r304797 (by jmmv):
Make use of Kyua's work directories.
Change the vnode tests to use the current directory when creating temporary
files, which we can assume is a volatile work directory, and then make the
kqueue_test.sh driver _not_ abandon the directory created by Kyua.
This makes the various kqueue tests independent of each other, and ensures
the temporary file is cleaned up on failure.
Problem spotted by asomers@ when reviewing D4254.
r305467:
Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...
This is being done to clearly distinguish the libkqueue tests
from the (soon to be imported) NetBSD tests.
This also contains a merge of ^/projects/netbsd-tests-update-12@r304035 .
This change never hit ^/head because bin/cat's behavior was changed (on ^/head)
to match NetBSD.
PR: 210607
r305358:
Update contrib/netbsd-tests with new content from NetBSD
This updates the snapshot from 09/30/2014 to 08/11/2016
This brings in a number of new testcases from upstream, most
notably:
lib/libc/tests/stdio/open_memstream_test.c was moved to
lib/libc/tests/stdio/open_memstream2_test.c to accomodate
the new open_memstream test from NetBSD.
Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
r305449:
Install h_db to unbreak some of the lib/libc/db testcases after
r305358
r305451:
Fix lib/libc/rpc test assumptions added in r305358
- Require root in the tcp/udp subtests (it's needed on FreeBSD when
registering services).
- Skip the tests if service registration fails.
r306367 (by br):
Allow up to 6 arguments only on MIPS.
r306397 (by br):
Use right piece of code for FreeBSD.
r309474:
Don't build :strvis_locale if VIS_NOLOCALE is undefined
The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features
in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower
in conditionally running the test instead of backporting the newer version of
libc-vis
ngie [Thu, 9 Feb 2017 22:49:48 +0000 (22:49 +0000)]
MFC r289172,r290254:
r289172:
Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)
- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity
ngie [Thu, 9 Feb 2017 22:04:56 +0000 (22:04 +0000)]
MFC r258903,r264487,r271699,r288415:
r258903 (by markj):
Enable some previously-disabled DTrace tests for umod, ufunc and usym. They
expect the installed ksh binary to be named "ksh", which is not the case
when it's installed on FreeBSD via the shells/ksh93 port. Allow for it to be
"ksh93" as well so that the tests can actually pass.
r264487 (by markj):
Replace a few Solarisisms with their corresponding FreeBSDisms to make a few
printf tests pass.
r271699 (by markj):
Implement a workaround to allow this test program to be compiled with clang.
It seems that if a pragma is used to define a weak alias for a local
function, the pragma must appear after the function is defined.
PR: 193056
r288415 (by markj):
MFV r288408:
6266 harden dtrace_difo_chunksize() with respect to malicious DIF
ngie [Thu, 9 Feb 2017 21:54:18 +0000 (21:54 +0000)]
MFC r277912,r278738,r279418,r280835,r288416:
r277912 (by markj):
Include required headers in DTrace test programs.
r278738 (by markj):
Tweak the fds test program so that it actually compiles. Also use 0 instead
of -1 for the bogus ioctl command so that dmesg doesn't get spammed with
sign extension warnings when the test program runs.
r279418 (by markj):
Add infrastructure to integrate the DTrace test suite with Kyua.
For each test category, we generate a script containing ATF test cases for
the tests under that category. Each test case simply runs dtest.pl (the
upstream test harness) with the corresponding test files. The exclude.sh
script is used to record info about tests which should be skipped or are
expected to fail; it is used to generate atf_skip and atf_expect_fail calls.
The genmakefiles.sh script can be used to regenerate the test makefiles when
new tests are brought it from upstream.
The test suite is currently not connected to the build as there is a small
number of lingering test issues which still need to be worked out. In the
meantime however, the test suite can be easily built and installed
manually from cddl/usr.sbin/dtrace/tests.
r280835 (by markj):
Replace dtest.pl, the upstream DTrace test suite harness, with a shell
script. This reimplementation is much simpler than dtest.pl and is more
amenable to being run under Kyua - dtest.pl writes error output to a
temporary directory that is deleted when the run finishes, making it hard
to debug test failures. This change also removes the test suite's dependency
on perl.
ngie [Thu, 9 Feb 2017 21:29:18 +0000 (21:29 +0000)]
MFC r276527:
Don't install h_raw if dealing with clang 3.5.0+ to unbreak the tests2 Jenkins
job
The h_raw application doesn't do proper bounds checking without the option
being supplied via the build, which means that it doesn't throw signals and
fail as expected
ngie [Thu, 9 Feb 2017 21:12:26 +0000 (21:12 +0000)]
MFC r305483,r306030,r306031,r306033,r306036:
r305483:
Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)
Pointyhat to: ngie
r306030:
Port vnode_leak_test:main to FreeBSD
Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`
The awk filtering method employed in NetBSD doesn't work on FreeBSD
r306031:
Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD
Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs
r306033:
Port sizes_test and statvfs_test to FreeBSD
Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD
r306036:
Port to mknod_test and readdir_test to FreeBSD
The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).
Taking closer look on my ASM1062 I found that it has bunch of issues around
error recovery: reported wrong CCS, failed commands reported as completed,
READ LOG EXT times out after NCQ error. This patch workarounds first two
problems, that were making ATAPI devices close to unusable on these HBAs.