Commit Graph

200959 Commits

Author SHA1 Message Date
kib
8a5352a05e MFC r292620:
Show the actual error code when interpreter cannot be loaded.
2015-12-29 16:09:15 +00:00
ngie
6a3209fa70 MFC r292585:
Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on

Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-29 01:08:58 +00:00
ngie
5d20de4a86 MFC r292582:
Dump out the output from flock_helper on failure so failures with the
test app can be debugged

Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division
2015-12-29 01:08:07 +00:00
ngie
27241dd28b MFC r292581:
Use stable output to a test file instead of depending on the OS name being
grep'able in /bin/sh

This fixes the situation where the OS has been rebranded to something other
than `FreeBSD`

Obtained from: Isilon OneFS (^/onefs/head@r511419)
Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
Sponsored by: EMC / Isilon Storage Division
2015-12-29 01:07:00 +00:00
ngie
1afba7abbc MFC r292578:
Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test

The default `sysctl kern.corefile` value is compatible with `kyua test` (FreeBSD
will dump to the current directory). If it's set to an absolute path however,
`kyua test` will not be able to clean up the corefiles after the fact

The corefiles have little value when testing the behavior of feature behavior,
so just disable corefile generation

Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division
2015-12-29 01:05:48 +00:00
ume
8dfa514cac MFC r292550, r292595:
Simplify _map_v4v6_address().
  We don't need to use a temporary buffer, here.
2015-12-29 00:42:35 +00:00
ngie
113fbc5161 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"

Sponsored by: EMC / Isilon Storage Division
2015-12-28 23:32:27 +00:00
ngie
938f5957c2 MFC r292317,r292318,r292323,r292324,r292665:
r292317:

Integrate tools/regression/lib/libc/resolv into the FreeBSD test suite as
lib/libc/tests/resolv

Convert the testcases to ATF

Sponsored by: EMC / Isilon Storage Division

r292318:

Add Makefile accidentally missed in r292317

Sponsored by: EMC / Isilon Storage Division

r292323:

Integrate tools/regression/lib/libc/nss into the FreeBSD test suite as
lib/libc/tests/nss

- Convert the testcases to ATF
- Do some style(9) cleanups:
-- Sort headers
-- Apply indentation fixes
-- Remove superfluous parentheses
- Explicitly print out debug printfs for use with `kyua {debug,report}`; for
  items that were overly noisy, they've been put behind #ifdef DEBUG
  conditionals
- Fix some format strings

Sponsored by: EMC / Isilon Storage Division

r292324:

Iterate down lib/libc/tests/nss...

Sponsored by: EMC / Isilon Storage Division

r292665:

Increase the timeout for resolv_test from the default (300 seconds) to
450 seconds

This is required on slower network connections, and on older releases
(stable/10 seems to be slower as far as name resolution goes.. not sure
why yet).

Remove an outdated comment in the Makefile from when I was working on
this code over a year ago on github

Sponsored by: EMC / Isilon Storage Division
2015-12-28 23:05:13 +00:00
jilles
b079803a46 MFC r290515: periodic: Fix backwards compatibility for
daily_status_security_* vars.

Most daily_status_security_* variables in periodic.conf were changed to
security_status_* in SVN r254974. The compatibility code for the old names
did not work.

PR:		204331
Submitted by:	martin at lispworks.com
2015-12-28 21:35:06 +00:00
dteske
b1dd9554ee MFC r290337: Add sysrc(8) support for "rc.conf.d"
Differential Revision:	https://reviews.freebsd.org/D3551
Reviewed by:	allanjude
Relnotes:	yes
2015-12-28 17:50:31 +00:00
kib
70f106975f MFC r292541:
Recheck curthread->td_su after the VFS_SYNC() call.
2015-12-28 09:03:29 +00:00
ume
b20f90aa79 MFC r292445, r292554:
Use _map_v4v6_address().
2015-12-28 03:37:13 +00:00
ume
98e3a0ddfe MFC r292539:
If we end up following a CNAME chain that does not find
  any data return that instead of internal error.

PR:		156684
2015-12-28 03:26:16 +00:00
pkelsey
ca800abb78 MFC r292706:
Implementation of server-side TCP Fast Open (TFO) [RFC7413].

TFO is disabled by default in the kernel build.  See the top comment
in sys/netinet/tcp_fastopen.c for implementation particulars.

Differential Revision:	https://reviews.freebsd.org/D4350
Sponsored by:	Verisign, Inc.
2015-12-28 02:43:12 +00:00
ngie
a2034803c3 MFC r292507,r292508:
r292507:

- Use LOCALBASE instead of KYUA_PREFIX for the --prefix to kyua(1)
- Use LOCALBASE instead of hardcoding /usr/local for perl

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

r292508:

Document LOCALBASE in the bsd.test.mk section

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-28 00:05:31 +00:00
cy
9890a61c16 MFC r292518.
Don't assume checksums will be calculated later when fastfoward is
enabled (by default in r290383).

PR:		72210
2015-12-27 23:25:21 +00:00
ngie
dd77e1af1b MFC r292489:
Disable test-ctrig.t testcases which fail assertions on i386

Tested on: stable/10 (amd64/i386), head (amd64/i386)
PR: 205446
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division
2015-12-27 21:17:30 +00:00
ngie
6f1df16e2f 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
2015-12-27 21:08:46 +00:00
marius
3376899410 MFC: r285684 (partial)
Record dependencies of gdb/gdbtui/kgdb on binutils/lib{bfd,iberty,opcodes},
fixing parallel builds.
2015-12-27 21:08:09 +00:00
ngie
2b3df2528e MFC r292661:
Remove redundant vmbus_select_outgoing_channel declaration already handled
in include/hyperv.h

This unbreaks the gcc 4.2.1 kernel build of hyperv

Differential Revision: https://reviews.freebsd.org/D4684
Reviewed by: royger
Sponsored by: EMC / Isilon Storage Division
2015-12-27 21:03:39 +00:00
ngie
1a7d083ff2 MFC r284969:
r284969 (by lwhsu):

- Fix `make depend` in sys/modules

Differential Revision:	https://reviews.freebsd.org/D2951
Approved by:	delphij
2015-12-27 21:02:56 +00:00
ngie
07fae805ed 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

PR: 205448
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

r292496:

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
2015-12-27 20:54:48 +00:00
marius
1ef54c4f8c MFC: r285840
- In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
  raw data to the doorbell offset in order to clarify the intent and for
  avoiding unnecessarily converting the endianess back and forth.
  Unfortunately, the same can't be done in mpt_recv_handshake_reply() as
  16-bit data needs to be read using 32-bit bus accessors.
- In mpt_recv_handshake_reply(), get rid of a redundant variable.
2015-12-27 20:52:32 +00:00
marius
69fca9363a 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 (r262363 in stable/10) for resolving a
  conflict with umodem(4). Eventually, in r275790 (r276243 in stable/10)
  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.
2015-12-27 20:49:32 +00:00
marius
6933dd0d85 MFC: r285912
- Use __FBSDID().
- Const'ify cons_to_vga_colors.
- Fix line wrapping.
2015-12-27 19:47:56 +00:00
marius
a31458dd6b MFC: r287726
- Factor out the common and generic parts of the sparc64 host-PCI-bridge
  drivers into the revived sys/sparc64/pci/ofw_pci.c, previously already
  serving a similar purpose. This has been done with sun4v in mind, which
  explains a) the otherwise not that obvious scheme employed and b) why
  reusing sys/powerpc/ofw/ofw_pci.c was even lesser an option.
- Add a workaround for QEMU once again not emulating real machines, in
  this case by not providing the OFW_PCI_CS_MEM64 range. [1]

Submitted by:	jhb [1]
2015-12-27 19:37:47 +00:00
marius
111ac5b2ca MFC: r287728
Merge r286374 from x86:

Formally pair store_rel(&smp_started) with load_acq(&smp_started).
Similarly to x86, this change is mostly a NOP due to the kernel
being run in total store order.
2015-12-27 17:58:58 +00:00
jilles
8eba600011 MFC r292517: sh/mknodes: Close files and check for errors when writing.
This is a build tool only and does not affect run time.

PR:		204951
2015-12-27 17:53:39 +00:00
marius
14a25019d6 MFC: r287767
- Sanity check that the parent ranges given in the "ranges" property
  of PCI-EBus-bridges actually match the BARs as specified in and
  required by [1, p. 113 f.]. Doing so earlier would have simplified
  diagnosing a bug in QEMU/OpenBIOS getting the mapping of child
  addresses wrong, which still needs to be fixed there.
  In theory, we could try to change the BARs accordingly if we hit
  this problem. However, at least with real machines changing the
  decoding likely won't work, especially if the PCI-EBus-bridge is
  beneath an APB one. So implementing such functionality generally
  is rather pointless.
- Actually change the allocation type of EBus resources if they
  change from SYS_RES_MEMORY to SYS_RES_IOPORT when mapping them
  to PCI ranges in ebus_alloc_resource() and passing them up to
  bus_activate_resource(9). This may happen with the QEMU/OpenBIOS
  PCI-EBus-bridge but not real ones. Still, this is only cleans up
  the code and the result of resource allocation and activation is
  unchanged.
- Change the remainder of printf(9) to device_printf(9) calls and
  canonicalize their wording.

Peripheral Component Interconnect Input Output Controller,
Part No.: 802-7837-01, Sun Microelectronics, March 1997 [1]
2015-12-27 17:51:10 +00:00
marius
b65a25360b 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/10 in r285177) 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.
2015-12-27 17:34:18 +00:00
marius
8b47bee5a7 MFC: r271864
Move rl(4) to dev/rl.
2015-12-27 17:12:54 +00:00
jilles
a0fabd0e1a MFC r292513: clock_gettime(2),gettimeofday(2): Remove [EFAULT] error.
Depending on system configuration and parameters, clock_gettime() and
gettimeofday() may not be system calls. If so, passing an invalid pointer
will cause a signal and not an [EFAULT] error.

From a standards perspective, this is OK since passing an invalid pointer is
undefined behaviour.
2015-12-27 15:30:13 +00:00
marius
ec568734f0 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]

PR:		188899 (non-original problem) [1]
Submitted by:	yongari [2]
2015-12-27 15:18:01 +00:00
marius
f90fadc507 MFC: r291121
Merge from r290547:
Since r289279 bufinit() uses mp_ncpus so adapt to what x86 does and
set this variable already in cpu_mp_setmaxid().
While at it, rename cpu_cpuid_prop() to cpu_portid_prop() as well as
the MD cpuid variable to portid to avoid confusion with the MI use
of "cpuid" and make some variable static/global in order to reduce
stack usage.

PR:		204685
2015-12-27 14:39:47 +00:00
julian
8ff50a25ee MFH: r278640
Revise default limit for maximum of netgraph data items.
With modern internet speeds the limit can be reached even
on a single L2TP link.
2015-12-27 13:37:14 +00:00
ngie
6e67341ec3 MFC r292493:
Don't run test-fma on i386

It completely fails all assertions on i386 on both stable/9 and stable/10

PR: 205448
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division
2015-12-27 11:12:09 +00:00
ngie
b8f4d2f02a MFC r292500,r292501,r292504,r292509:
r292500:

Simplify Kyuafile generation logic with KYUAFILE == auto and
related complexity with variables

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

r292501:

Fix typo in r292500 by adding missing conditional statement

Pointyhat to: ngie
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Sponsored by: EMC / Isilon Storage Division

r292504:

Deal with another hardcoded reference to Kyuafile in the KYUAFILE == auto
case

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

r292509:

Clean up Kyuafile.tmp, not Kyuafile.auto.tmp

Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-27 11:04:11 +00:00
kib
07bab8ce9f MFC r292510:
Fix lockf(3) cancellation behaviour.
2015-12-27 00:42:13 +00:00
ume
6885269fd5 MFC r292514:
addrinfo.ai_family is an address family, not a protocol family.

PR:		162434
2015-12-27 00:37:04 +00:00
pfg
1ee182fa5f MFC r292454, r292455
ed(1): Prevent possible string overflows

Use strlcpy to guarantee NULL termination.

With hint from:	imp, cem, ngie
CID:		1007252
2015-12-26 18:37:01 +00:00
pfg
c41fd18fc0 MFC r291155:
bc: sync with OpenBSD

tty.c Rev. 1.3
Avoid unintended problems with operator precedence when doing an
assignment and comparison.

bc.1, Rev. 1.31, 1.32
'.Ql Quit' -> '.Ql quit' because only the lowercase command is valid.
Clarify sentence about `quit` in BUGS section.

extern.h, Rev. 1.12
whitespace

bc.y, Rev. 1.47
Prefer setvbuf() to setlinebuf() for portability

Obtained from:	OpenBSD
2015-12-26 18:26:44 +00:00
ume
ea7b0bc9d3 MFC 276962:
Do not regenerate and install liblzma.pc when only build libraries
  aka do not regenerate while generating 32bits libs

Reported by:	Shin-ichi Okano <s-okano__at__n08.itscom.net>
2015-12-26 12:06:52 +00:00
kib
4091b74ce5 MFC r292128:
In md(4) over vnode, correct handling of the unaligned unmapped io
requests which page alignment + size is greater than MAXPHYS. Split
request up to the size of io which fits into pbuf KVA with alignment,
and retry if a part of the bio is left unprocessed.
2015-12-26 11:10:44 +00:00
ume
55621219f5 Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).
PR:		198092
2015-12-25 11:17:21 +00:00
ume
8feffa60ae 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.
2015-12-25 10:53:30 +00:00
brueffer
93f5797f20 MFH: r292263
Assorted grammar, spelling and punctuation fixes.

PR:		203336, 203339
Submitted by:	espeyb@rpi.edu, themesta@gmail.com
2015-12-24 20:15:14 +00:00
jlh
bed33ef6ee MFC r292564:
Add port for IRC over TLS/SSL, as noted in RFC 7194.

    PR:		    192505
    Submitted by:   loic.blot@unix-experience.fr

MFC r292694:

    Replace all whitespaces between port name and number with tabs.
2015-12-24 16:55:09 +00:00
lidl
c598c5a4e9 MFC r292313:
Skip unavailable pools when running zfs pool scrubs

Approved by:	rpaulo (mentor)
2015-12-23 21:59:38 +00:00
lidl
8d600f995b MFC r290405:
Restrict 520.pfdenied to only list rules that blocked traffic.
Before this change, the 520.pfdenied script listed all rules that
matched /^block/ in the rule. Restrict the printed output to only
those rules that result in packets being dropped.

Approved by:	rpaulo (mentor)
2015-12-23 21:57:26 +00:00
jilles
ce8728e0fa MFC r292360: sh: Fix use-after-free when attempting to modify a read-only
variable.

Reported by:	bapt
2015-12-23 18:24:40 +00:00