ngie [Mon, 14 Mar 2016 00:40:57 +0000 (00:40 +0000)]
MFstable/10 r296814:
MFC r293621,r293622,r293815:
r293621:
- Delete non-TAP testcases
- Add a conf.sh file for executing common functions with geom_gate
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
- Add/increase sleeps to try and improve synchronization
- Add debug output for when checksums fail
test-1.t:
- Use pkill for killing ggated
r293622:
Remove Makefile now that the testcases are all TAP based and
prove -rv can be used on them
dim [Sun, 13 Mar 2016 18:32:18 +0000 (18:32 +0000)]
Pull in r219512 from upstream llvm trunk (by Hal Finkel):
[MiSched] Fix a logic error in tryPressure()
Fixes a logic error in the MachineScheduler found by Steve Montgomery
(and confirmed by Andy). This has gone unfixed for months because the
fix has been found to introduce some small performance regressions.
However, Andy has recommended that, at this point, we fix this to
avoid further dependence on the incorrect behavior (and then
follow-up separately on any regressions), and I agree.
Fixes PR18883.
This fixes a possible "ran out of registers" error when compiling
www/firefox 45.0 on i386.
Direct commit to stable/9, because head already has this fix since the
llvm/clang 3.6.0 import.
ngie [Sun, 13 Mar 2016 02:09:01 +0000 (02:09 +0000)]
MFstable/10 r296787:
MFC r293443:
- Make test-1.sh into a TAP testable testcase
- Delete test-2.sh as it was an incomplete testcase, and the contents were
basically a subset of test-1.sh
- Add a conf.sh file for executing common functions with geom_uzip
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 02:08:23 +0000 (02:08 +0000)]
MFstable/10 r296786:
MFC r293442:
- Add a geom_stripe specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 02:07:45 +0000 (02:07 +0000)]
MFstable/10 r296785:
MFC r293441:
- Add a geom_shsec specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 02:06:57 +0000 (02:06 +0000)]
MFstable/10 r296784:
MFC r293438:
- Add a geom_raid3 specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 02:06:09 +0000 (02:06 +0000)]
MFstable/10 r296783:
MFC r293437:
- Add a conf.sh file for executing common functions with gnop
- Use attach_md for attaching md(4) devices
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sun, 13 Mar 2016 02:05:16 +0000 (02:05 +0000)]
MFstable/10 r296782:
MFC r293436:
- Add a conf.sh file for executing common functions with geli
-- Use linear probing to find the first unique md(4) device, unlike the other
code which uses attach_md, as geli(8) allocates the md(4) devices itself
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
ngie [Sat, 12 Mar 2016 23:12:23 +0000 (23:12 +0000)]
MFstable/10 r296777:
MFC r293434:
- Use attach_md for memory disks so they can be tracked.
- Add a geom_concat specific cleanup function and trap on that function at
exit so things are cleaned up properly
- Don't hardcode /tmp for temporary files, which violates the kyua sandbox
bdrewery [Sat, 12 Mar 2016 19:07:08 +0000 (19:07 +0000)]
MFC r296286,r296470,r296472,r296473,r296575:
r296286:
Remove filemon->lock wrappers.
r296470:
Only call bwillwrite() for logging to vnodes, as other fo_write() calls do.
r296472:
Require kldunload -f to unload.
r296473:
Add missing break for r296472.
r296575:
FILEMON_SET_FD: Disallow changing the fd.
jkim [Fri, 11 Mar 2016 22:45:23 +0000 (22:45 +0000)]
Link ntp-keygen(8) with pthread. Note this is a direct commit to stable/9
because head and stable/10 were fixed differently with r280849 and r285612,
respectively.
delphij [Mon, 7 Mar 2016 16:18:07 +0000 (16:18 +0000)]
Fix multiple OpenSSL vulnerabilities as published in
OpenSSL advisory on 2016/03/01:
constant-time MOD_EXP_CTIME_COPY_FROM_PREBUF.
[CVE-2016-0702, upstream d6482a8. 5ea08bd, d6d422e, 8fc8f48317be63 skipped intentionally as we are not
using the code on FreeBSD. Backport done by jkim@.
Fix memory issues in BIO_*printf functions.
[CVE-2016-0799, upstream d889682, a801bf2].
Disable SSLv2 in default negotiation and weak ciphers.
[CVE-2016-0800 "DROWN", upstream 56f1acf5]. Note that
support of SSLv2 is not removed in order to preserve
ABI compatibility, and application may still explicitly
ask for vulnerable protocol or ciphers.
pfg [Mon, 7 Mar 2016 15:20:59 +0000 (15:20 +0000)]
Revert r286714: Add a new option "-fstack-protector-strong".
The stack-protector-strong option was causing problems when building
perl5. This was never within the official featureset of the older GCC
4.x toolchain so just drop it to avoid patching the perl port.
hselasky [Mon, 7 Mar 2016 10:02:31 +0000 (10:02 +0000)]
MFC r295928:
Configure the correct bMaxPacketSize for control endpoints before
requesting the initial complete device descriptor and not as part of
the subsequent babble error recovery. Babble means that the received
USB packet was bigger than than configured maximum packet size. This
only affects enumeration of FULL speed USB devices which use a
bMaxPacketSize different from 8 bytes. This patch might help fix
enumeration of USB devices which exhibit USB I/O errors in dmesg
during boot.
dim [Mon, 7 Mar 2016 07:57:57 +0000 (07:57 +0000)]
MFC r296419 (by kib):
In the link_elf_obj.c, handle sections of type SHT_AMD64_UNWIND same
as SHT_PROGBITS. This is needed after the clang 3.8 import, which
generates that type for .eh_frame section, which had SHT_PROGBITS type
before.
Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
PR: 207729
Tested by: dim (previous version)
Sponsored by: The FreeBSD Foundation
MFC r296428:
Since kernel modules can now contain sections of type SHT_AMD64_UNWIND,
the boot loader should not skip over these anymore while loading images.
Otherwise the kernel can still panic when it doesn't find the .eh_frame
section belonging to the .rela.eh_frame section.
Unfortunately this will require installing boot loaders from sys/boot
before attempting to boot with a new kernel.
dim [Mon, 7 Mar 2016 07:49:01 +0000 (07:49 +0000)]
MFC r295901:
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.
r294949:
filemon_ioctl: Handle error from devfs_get_cdevpriv(9).
r294952:
filemon_ioctl: Lock the associated filemon handle before writing to it.
r294953:
filemon_comment has nothing to do with wrappers so move it out of
filemon_wrapper.c.
r294957:
filemon_dtr: Lock the associated filemon handle before writing to it.
r294965:
filemon: Use process_exit EVENTHANDLER to capture process exit.
r294967:
filemon: Trace fork via process_fork event.
r294968:
Follow-up r294967: Mark flags unused.
r295017:
filemon: Use process_exec EVENTHANDLER to capture sys_execve.
r295026:
filemon_open: Don't record a process to trace here.
r295027:
filemon: Track the process pointer rather than a pid.
r295029:
Document the purpose and non-purpose of filemon(4).
r295030:
Note the double fork behavior with filemon.
r295649:
filemon: Fix panic when fork1() is called from kproc_create().
bdrewery [Sat, 27 Feb 2016 20:51:42 +0000 (20:51 +0000)]
MFC r250658,r250828:
r250658:
Add a new option WITHOUT_FORMAT_EXTENSIONS to disable flags related to
checking our kernel printf extensions. This is useful to allow compilers
without these extensions to build kernels.
r250828:
Spell extensions correctly.
davidcs [Thu, 25 Feb 2016 18:25:36 +0000 (18:25 +0000)]
MFC r295823
Modified the use of bxe_grc_dump() function so that it can be invoked directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved.
The sysctl trigger_grcdump can be used to manually trigger a fwdump.
dim [Wed, 24 Feb 2016 07:53:57 +0000 (07:53 +0000)]
MFC r295844:
Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).
Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
messages, if you pass in invalid types, sources or column names for "zfs
get", "zfs list" and "zpool get". This is because the commands use
getsubopt(3), and in case of failure, they print 'value', which is NULL
when sub options don't match.
They should print 'suboptarg' instead, which is the documented way to
get at the non-matching sub option value.
des [Sat, 20 Feb 2016 13:36:24 +0000 (13:36 +0000)]
MFH (r273114, r273124): turn SSLv3 off by default
MFH (r294326): fall back to standard / configured CA store
MFH (r295536): fix double-free when SSL connection fails
pfg [Wed, 17 Feb 2016 19:11:09 +0000 (19:11 +0000)]
MFC r295616:
ext2fs: Remove panics for rename() race conditions.
Sync with r84642 from UFS:
The panics are inappropriate because the IN_RENAME flag only fixes a
few of the huge number of race conditions that can result in the
source path becoming invalid even prior to the VOP_RENAME() call.
jhb [Wed, 17 Feb 2016 01:45:34 +0000 (01:45 +0000)]
MFC 295418,295419:
Fix hangs or panics when misbehaved kernel threads return from their
main function.
295418:
Mark proc0 as a kernel process via the P_KTHREAD flag.
All other kernel processes have this flag set and all threads in proc0
(including thread0) have the similar TDP_KTHREAD flag set.
295419:
Call kthread_exit() rather than kproc_exit() for a premature kthread exit.
Kernel threads (and processes) are supposed to call kthread_exit() (or
kproc_exit()) to terminate. However, the kernel includes a fallback in
fork_exit() to force a kthread exit if a kernel thread's "main" routine
returns. This fallback was added back when the kernel only had processes
and was not updated to call kthread_exit() instead of kproc_exit() when
threads were added to the kernel.
This mistake was particularly exciting when the errant thread belonged to
proc0. Due to the missing P_KTHREAD flag the fallback did not kick in
and instead tried to return to userland via whatever garbage was in the
trapframe. With P_KTHREAD set it tried to terminate proc0 resulting in
other amusements.
cy [Wed, 10 Feb 2016 07:16:22 +0000 (07:16 +0000)]
MFC r289421, r293037, r294773, and r294884.
ntp leap-leapseconds support.
r289421:
Add default leap-seconds file. This should help ntp networks get the
leap second date correct
Updates to the file can be obtained from ftp://time.nist.gov/pub/ or
ftp://tycho.usno.navy.mil/pub/ntp/.
r293037:
Update leap-seconds to latest. This will satisfy the ntpd leap-second
version check.
r294773:
Add support for automatic leap-second file updates.
The working copy of leapfile resides in /var/dbntpd.leap-seconds.list.
/etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/
or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should
automatic leapfile updates be disabled (default).
Automatic leapfile updates are fetched from $ntp_leapfile_sources,
defaulting to https://www.ietf.org/timezones/data/leap-seconds.list,
within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds
file expiry. Automatic updates can be enabled by setting
$daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting
the ntp leapfile source the automatic update randomized by default but
can be disabled through daily_ntpd_avoid_congestion="NO" in
periodic.conf.
r294884:
Allow specification of fetch options for ntp leap-seconds fetch.
pfg [Sat, 6 Feb 2016 17:10:46 +0000 (17:10 +0000)]
MFC r295209;
Revert r294695; passthrough any extra timestamps to the dinode struct.
The original ext2fs change worked fine on disks formated with default
values, but it was the cause of a regression when inodes are small.
Revert it for now, while we figure out safer ways pass such values,
ume [Wed, 3 Feb 2016 11:41:55 +0000 (11:41 +0000)]
MFC r295147:
Make dynamic link of libiconv from ports work again.
The symbols of libiconv from ports were changed to
have prefixed.
Since we have iconv in our libc these days, we don't
need it on 10.X and later. However, 9.X still need
this.
pfg [Thu, 28 Jan 2016 02:21:20 +0000 (02:21 +0000)]
MFC r294695:
ext2fs: passthrough any extra timestamps to the dinode struct.
In general we don't trust any of the extended timestamps unless the
EXT2F_ROCOMPAT_EXTRA_ISIZE feature is set. However, in the case where
we freshly allocated a new inode the information is valid and it is
better to pass it along instead of leaving the value undefined.
This should have no practical effect but should reduce the amount of
garbage if EXT2F_ROCOMPAT_EXTRA_ISIZE is set, like in cases where the
filesystem is converted from ext3 to ext4.
delphij [Wed, 27 Jan 2016 07:34:23 +0000 (07:34 +0000)]
MFC r294900:
Implement AT_SECURE properly.
AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a
boolean flag indicating whether secure mode should be enabled. 1 means
that the program has changes its credentials during the execution.
Being exported AT_SECURE used by glibc issetugid() call.
des [Tue, 26 Jan 2016 07:44:26 +0000 (07:44 +0000)]
MFH (r261233): cleanup
MFH (r261234): increase buffer size
MFH (r280630): remove all traces of SSLv2 support
MFH (r285141): remove unused variable
MFH (r288217): correctly check return value from getaddrinfo(3)
MFH (r289419): fix bugs in HTTPS tunnelling
MFH (r289420): use fopen()'s "e" mode instead of fcntl for close-on-exec
MFH (r291453, r291461): use .netrc for http servers and proxies
MFH (r292330, r292332): reset bufpos to 0 after refilling in chunked mode
ngie [Sun, 24 Jan 2016 06:20:57 +0000 (06:20 +0000)]
MFstable/10 r294657:
MFC r293073:
- Use attach_md instead of hardcoding md(4) provider unit numbers
- Implement a gmirror_test_cleanup function, which in turn calls
geom_test_cleanup to clean up all md(4) providers allocated in the test
run.
- Remove duplicate logic in test scripts for removing md(4) providers.
- Don't create files in /tmp (outside the kyua sandbox); use the current
directory instead
jhb [Sat, 23 Jan 2016 17:08:17 +0000 (17:08 +0000)]
MFC 294366:
Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0.
If a driver's Linux mmap callback passed vm_page_prot through unchanged,
then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx
value 0 is to the mapping. On x86, VM_MEMATTR_DEFAULT is the PAT value
for write-back (WB) which is 6, while 0 maps to the PAT value for
uncacheable (UC). Thus, any mmap request that did not explicitly set
page_prot was tried to map memory as UC triggering the warning in
sg_pager_getpages().
ngie [Fri, 22 Jan 2016 07:25:41 +0000 (07:25 +0000)]
MFstable/10 r294550:
MFC r293048,r293444:
r293048:
- Use a temporary file for the temporary md(4) devices instead of
hardcoding it
- Remove the temporary file in the cleanup routine
r293444:
- Move functions that might be used in class-specific cleanup functions
(geom_test_cleanup, etc) down so the testcases don't emit noise when
bailing
- Conform to the TAP protocol better when dealing with classes that can't
be loaded and with temporary files that can't be allocated for tracking
md(4) devices.
dim [Tue, 19 Jan 2016 18:35:22 +0000 (18:35 +0000)]
MFC r294102:
MFV r294101: 6527 Possible access beyond end of string in zpool comment
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gwr@nexenta.com>
This fixes erroneous double increments of the 'check' variable in a loop
in spa_prop_validate(). I ran into this in the clang380-import branch,
where clang 3.8.0 warns about it. (It is already fixed there.)
pfg [Tue, 19 Jan 2016 14:15:09 +0000 (14:15 +0000)]
Revert r294273
MFC r293680
ext4: add support for reading sparse files
The change was meant for newer versions and doesn't work out of the box.
While it seems easy to adapt I prfer not to have the implementations
diverge at this time.
pfg [Mon, 18 Jan 2016 15:43:37 +0000 (15:43 +0000)]
MFC r293680
ext4: add support for reading sparse files
Add support for sparse files in ext4. Also implement read-ahead, which
greatly increases the performance when transferring files from ext4.
The sparse file support has become very common in ext4.
ae [Mon, 18 Jan 2016 11:51:41 +0000 (11:51 +0000)]
MFC r293679:
Change the type of newsize argument in the smbfs_smb_setfsize() function
from int to int64.
MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer
to specify offset, but since smbfs_smb_setfsize() has used plain int,
a value was truncated in case when offset was larger than 2G.
https://msdn.microsoft.com/en-us/library/ff469975.aspx
In particular, now `truncate -s 10G` will work correctly on the mounted
SMB share.
ngie [Mon, 18 Jan 2016 03:52:44 +0000 (03:52 +0000)]
MFstable/10 r294240:
MFC r293705:
Similar to r293704, fix theoretical leak of netconfig(3) resources in
__rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating
resources, but not completely successful by moving the endnetconfig(3) call
up before we return from the function if nconf == NULL.
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
ngie [Mon, 18 Jan 2016 03:51:38 +0000 (03:51 +0000)]
MFstable/10 r294239:
MFC r293704:
Fix theoretical leak of netconfig(3) resources in svcunix_create(..)
In the event that the getconfig(3) call in svcunix_create is partly successful,
some of the netconfig(3) resources allocated might be leaked if the call returns
NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the
resources are fully cleaned up by going to the `done` label, which will call
endnetconfig(3) for us.
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
ngie [Fri, 15 Jan 2016 02:19:26 +0000 (02:19 +0000)]
MFstable/10 r294063:
MFC r293028,r293029:
r293028:
- Use geom <class> load instead of g<class> load; g<class> doesn't exist
for all geom classes, e.g. geom_uzip(4)
- These tests require root. Skip all of the tests if they're run as non-root
r293029:
Add functions for managing md(4) devices and cleaning up said md(4) devices
These will be used soon in the various test scripts that source geom_subr.sh
glebius [Thu, 14 Jan 2016 09:11:48 +0000 (09:11 +0000)]
o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]
o Fix ntp panic threshold bypass vulnerability. [SA-16:02.ntp]
o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux]
o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux]
o Fix TCP MD5 signature denial of service. [SA-16:05.tcp]
o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd]