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
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
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
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
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
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
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
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.
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
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
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
- 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.
- 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.
- 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]
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.
- 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]
- 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.
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.
- 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]
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
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
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
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
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>
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.
- 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.
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.
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)