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]
glebius [Wed, 13 Jan 2016 05:32:24 +0000 (05:32 +0000)]
Merge r291073:
If a NIS server has long entries on its database that is bigger than
1024 specified on YPMAXRECORD the ypmatch can get in an infinite retry
loop when is requesting the information from the NIS server.
The ypmatch(1) will return an error until the command receives an
kill(1).
To avoid this problem, we check the MAX_RETRIES that is by default set
to 20 and avoid get in infinet loop at the client side.
davidcs [Tue, 12 Jan 2016 23:44:03 +0000 (23:44 +0000)]
MFC r292638
Check for packet_length is greater than 60 bytes as well as packet_length is
greater than len_on_bd, before invoking the routine to handle jumbo over SGL
(bxe_service_rxsgl()).
Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and
erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts)
dim [Tue, 12 Jan 2016 19:33:43 +0000 (19:33 +0000)]
MFC r292950:
Drop the clang patch which adds recognition of 'CC' suffixes as aliases
for --driver-mode=g++, since this was never upstreamed. For backwards
compatibility, add a wrapper shell script.
ngie [Wed, 6 Jan 2016 20:09:51 +0000 (20:09 +0000)]
MFstable/10 r293246,r293257:
r293246:
MFC r292530,r292546:
r292530:
- Use 1 for an exit code instead of -1 with err, errx, and exit
- Add unistd.h for getuid(3)
- Sort #includes
r292546:
- Convert testcase to TAP format
- Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro
- Do not mark count != 0 case with bsde_get_rule_count as a failure; this
generates false positives on systems with ugidfw rules set on it
r293257:
MFC r292650,r292651:
r292650:
Move mac_bsdextended check up before running the test_libugidfw_strings testcases
I realize that these tests could be run before mac_bsdextended is loaded, but
it would overcomplicate things to special case handle the testcases before doing
the mac_bsdextended(4) feature check
The testcases will be split up so they can be run separately in the near future
r292651:
Delete the comment about running `test_libugidfw_strings` before testing
`mac_is_present` so it doesn't accidentally confuse people
dim [Sun, 3 Jan 2016 17:23:16 +0000 (17:23 +0000)]
MFC r293015:
Merge r293013 from clang380-import branch:
Fix a clang 3.8.0 warning in pflogd.c:
contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
if (!if_exists(interface) == -1) {
^ ~~
The if_exists() function does not return -1, and even if it did, it
would not be the correct way to check. Just ditch the == -1 instead.
dim [Sun, 3 Jan 2016 17:19:17 +0000 (17:19 +0000)]
MFC r293014:
Merge r293006 from clang380-import branch:
For determining the compiler version, quote the string to be echo'd,
otherwise the command might fail. This is because clang -v now results
in the following:
FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn)
The second "3.8.8svn)" string tripped up the shell command.
Add a .arcconfig to allow arc to work in its usual way.
r266120 (by bapt):
Add project name to the arc config it is still required when arcanist is used with SVN
r266121 (by bapt):
Add the missing coma
r266959 (by eadler):
arc: add linting for python files
r267148 (by bapt):
Prevent arc commands from overwriting history
r269985 (by gjb):
Update the URL to the phabricator instance.
Sponsored by: The FreeBSD Foundation
r281789 (by eadler):
phabricator related changes:
- don't lint either contrib or crypto: these are both externally written
directories
- add additional linters for spelling (check common typos like teh ->
the)
- chmod linter checks for executible bit on bad files
- merge-conflict checks for merge conflict tokens then may have been
resolved incorrectly
- filename checks for back characters in filenames
- json for json syntax correctness
- remove history.immutable: it is meaningless on subversion, and causes
workflow problems when trying to use git. It it set to 'true' by
default with hg
r282261 (by eadler):
Phabricator: enable "history.immutable":
With certain arc workflows leaving history.immutable as false
results in using the upstream template instead of our usual
commit template. Since the git workflow issues alluded to in my
prior commit message can be worked around, set history.immutable
once again.
r285064 (by mat):
Add repository.callsign, to help arcanist figure out what repo it's
doing things on when not using Subversion.
ngie [Tue, 29 Dec 2015 00:04:21 +0000 (00:04 +0000)]
MFstable/10 r292845:
MFC r292569:
Make the mac_portacl testcases work / more robust
- A trap(1) call has been added to the test scripts to better
ensure that the tests do a better job at trying to restore the
test host state at the end of the tests (if the test was
interrupted before it would leave the system in an odd state,
potentially making the test results for subsequent runs
non-deterministic).
- Add root user checks
- Fix nc(1) usage:
-- -o is deprecated
-- Using `-w 10` will make the call timeout after 10 seconds so it
doesn't block indefinitely
- Use local variables
- Be more terse in the error messages
- Parameterize out "127.0.0.1"
ngie [Sun, 27 Dec 2015 21:58:13 +0000 (21:58 +0000)]
MFstable/10 r226602:
r226602 (by das):
Tests for cancellation in fma(). Also include more tests for 128-bit
long doubles. Thanks for clusteradm (simon) for making the needed
hardware available.
ngie [Sun, 27 Dec 2015 21:55:26 +0000 (21:55 +0000)]
MFstable/10 r251053:
r251053 (by tijl):
Fix cexp regression tests that have an infinite real part. The signs of the
result depend on the cosine and sine of the imaginary part.
Small values are used in the new tests such that cosine and sine are well
defined.
- Use nitems instead of handrolling the macro
- Use a separate variable for tracking the testcase count instead
of hardcoding the offset for the testcases
Sponsored by: EMC / Isilon Storage Division
r292495:
Initialize j so it doesn't print out a garbage index
Use it consistently instead of i in the first loop
Sponsored by: EMC / Isilon Storage Division
r292647:
Use j instead of a hardcoded index (9) and increment it after
running the NaNs testcases
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division
ngie [Sun, 27 Dec 2015 21:34:37 +0000 (21:34 +0000)]
MFstable/10 r292795:
MFC r292491,r292493,r292496:
r292491:
Disable test-ctrig.t testcases which fail assertions on i386 [*]
Also, don't compile the exp2l(3) testcases on platforms that don't support the
libcall (technically only x86 right now). This makes this test buildable on
arm*/mips*/powerpc*
Tested on: stable/10 (amd64/i386), head (amd64/i386)
PR: 205446 [*]
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division
r292493:
Don't run test-fma on i386
It completely fails all assertions on i386 on both stable/9 and stable/10
Skip the testcases on i386 (all the assertions fail) [*]
Also, don't compile the ldexpl(3) testcases on platforms that don't support
the libcall (technically only x86 right now). This makes this test buildable on
arm*/mips*/powerpc*
PR: 205449 [*]
Tested on: stable/10 (amd64/i386), head (amd64/i386)
Sponsored by: EMC / Isilon Storage Division
ngie [Sun, 27 Dec 2015 21:15:58 +0000 (21:15 +0000)]
MFstable/10 r226377,r292799:
r226377 (by das):
Add some tests for double-rounding bugs in fma().
r292799:
MFC r292492,r292495,r292647:
r292492:
- Use nitems instead of handrolling the macro
- Use a separate variable for tracking the testcase count instead
of hardcoding the offset for the testcases
Sponsored by: EMC / Isilon Storage Division
r292495:
Initialize j so it doesn't print out a garbage index
Use it consistently instead of i in the first loop
Sponsored by: EMC / Isilon Storage Division
r292647:
Use j instead of a hardcoded index (9) and increment it after
running the NaNs testcases
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division
marius [Sun, 27 Dec 2015 20:49:36 +0000 (20:49 +0000)]
MFC: r285909, r285913 (partial)
- Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This
variant of Microsoft RNDIS, i. e. their unofficial version of CDC ACM,
has been disabled in r261544 (r262362 in stable/9) for resolving a
conflict with umodem(4). Eventually, in r275790 (r276244 in stable/9)
that problem was dealt with in the right way. However, r275790 failed
to put probing of RNDIS devices in question back.
- Initialize the device prior to querying it, as required by the RNDIS
specification. Otherwise already determining the MAC address may fail
rightfully.
- On detach, halt the device again.
- Use UCDC_SEND_ENCAPSULATED_{COMMAND,RESPONSE}. While these macros are
resolving to the same values as UR_{CLEAR_FEATURE,GET_STATUS}, the
former set is way more appropriate in this context.
- Report unknown - rather: unimplemented - events unconditionally and
not just in debug mode. This ensures that we'll get some hint of what
is going wrong instead of the driver silently failing.
- Deal with the Microsoft ActiveSync requirement of using an input buffer
the size of the expected reply or larger - except for variably sized
replies - when querying a device.
- Fix some pointless NULL checks, style bugs etc.
This changes allow urndis(4) to communicate with a Microsoft-certified
USB RNDIS test token.
marius [Sun, 27 Dec 2015 17:34:29 +0000 (17:34 +0000)]
MFC: r287768, r290566, r290946
- Although it doesn't make a whole lot of sense to enable RX and TX
before their initial configuration is done, it turns out that r281337
(MFCed to stable/9 in r285178) has the inverse effect on some older
chips. Moreover, as with newer chips before, two chips seemingly
identical according to their MAC revisions may behave differently in
this regard, with most working but a few not, making changes extremely
hard to test.
Closer inspection of the corresponding Linux code suggests that RX
and TX should only be enabled after their initial configuration with
RTL8168G and later chips, i. e. RTL8106E{,US}, RTL8107E, as well as
RTL8168{EP,G,GU,H}, so limit the new code path to these. [1]
- Distinguish between RTL8168H and RTL8107E, with the latter being the
10/100-Mbit/s-only variant of the former.
- For MAC variants that can only do Fast Ethernet at a maximum, ensure
that we don't advertise Gigabit Ethernet speed.
- In re_stop(), do the inverse of re_init_locked() and enable RXDV
gate on RTL8168G and later chips again, matching what Linux does.
- With the latter in place, it turns out that WOL previously only worked
by accident with RTL8168G and later chips when the interface actually
was brought up. This is due to the fact that with these MAC variants,
RXDV gate needs be disabled for WOL to work. So in re_setwol() do just
that when IFCAP_WOL is requested.
- Add preliminary support for RTL8168H and RTL8107E, with the latter
being the 10/100-Mbit/s-only variant of the former.
marius [Sun, 27 Dec 2015 15:55:15 +0000 (15:55 +0000)]
MFC: r286785, r291088, r291120
- Reformat x86 bounce buffer synchronization code to reduce indentation.
No functional change.
- Avoid a NULL pointer dereference in bounce_bus_dmamap_sync() when the
map has been created via bounce_bus_dmamem_alloc(). Even for coherent
DMA - which bus_dmamem_alloc(9) typically is used for -, calling of
bus_dmamap_sync(9) isn't optional. [1]
- Avoid a NULL pointer dereference in bounce_bus_dmamap_unload() when
the map has been created via bounce_bus_dmamem_alloc(). In that case
bus_dmamap_unload(9) typically isn't called during normal operation
but still should be during detach, cleanup from failed attach etc. [2]
kp [Fri, 25 Dec 2015 15:12:54 +0000 (15:12 +0000)]
pf: Fix IPv6 checksums with route-to.
When using route-to (or reply-to) pf sends the packet directly to the output
interface. If that interface doesn't support checksum offloading the checksum
has to be calculated in software.
That was already done in the IPv4 case, but not for the IPv6 case. As a result
we'd emit packets with pseudo-header checksums (i.e. incorrect checksums).
This issue was exposed by the changes in r289316 when pf stopped performing full
checksum calculations for all packets.
kp [Fri, 25 Dec 2015 15:12:11 +0000 (15:12 +0000)]
pf: Fix TSO issues
In certain configurations (mostly but not exclusively as a VM on Xen) pf
produced packets with an invalid TCP checksum.
The problem was that pf could only handle packets with a full checksum. The
FreeBSD IP stack produces TCP packets with a pseudo-header checksum (only
addresses, length and protocol).
Certain network interfaces expect to see the pseudo-header checksum, so they
end up producing packets with invalid checksums.
To fix this stop calculating the full checksum and teach pf to only update TCP
checksums if TSO is disabled or the change affects the pseudo-header checksum.
ume [Fri, 25 Dec 2015 10:55:39 +0000 (10:55 +0000)]
MFC r292435, r292441:
- Keep hosts.by{name,addr} IPv4 only.
- Add comment how we handle hosts and ipnodes.
- Generate ipnodes.by{addr,name} from /etc/hosts for
compatibility with FreeBSD local name resolution.
If /var/yp/ipnodes exists, we generate them from it
for backward compatibility.
vangyzen [Sat, 19 Dec 2015 02:49:59 +0000 (02:49 +0000)]
MFC r289315,r292216
resolver: automatically reload /etc/resolv.conf
On each resolver query, use stat(2) to see if the modification time
of /etc/resolv.conf has changed. If so, reload the file and reinitialize
the resolver library. However, only call stat(2) if at least two seconds
have passed since the last call to stat(2), since calling it on every
query could kill performance.
This new behavior is enabled by default. Add a "reload-period" option
to disable it or change the period of the test.
Document this behavior and option in resolv.conf(5).
vangyzen [Sat, 19 Dec 2015 02:47:05 +0000 (02:47 +0000)]
MFC r289837
resolver: abuse _res a little less
In the past, _res was a global variable. Now, it's multiple function calls.
Several functions in the resolver use _res multiple times and therefore
call the function(s) far more than necessary.
Fix those callers to store the result of _res in a local variable.
Add __noinline to the definition of res_init() to avoid the code bloat
that these changes would have otherwise incurred. Thanks to jilles
for noticing this.
ume [Sat, 19 Dec 2015 01:24:07 +0000 (01:24 +0000)]
MFC r292129:
RFC 3493 requires ignoring the loopback address for AI_ADDRCONFIG.
Since it breaks certain jail setup, we ignore just 127.0.0.1
instead of whole loopback address range.
jamie [Fri, 18 Dec 2015 00:33:03 +0000 (00:33 +0000)]
MFC r292277:
Fix jail name checking that disallowed anything that starts with '0'.
The intention was to just limit leading zeroes on numeric names. That
check is now improved to also catch the leading spaces and '+' that
strtoul can pass through.