203096 Commits

Author SHA1 Message Date
ngie
482bbaacb7 MFstable/11 r305914:
MFC r305357:

Skip testcases 9/10 if jail(8) isn't installed

These testcases require jail support
2016-09-18 04:34:32 +00:00
ngie
e07bfeff01 MFstable/11 r305912:
MFC r305356:

Add a missing "Bail out!" if zpool create fails

This will make the exit info more meaningful if/when zpool create fails,
and establishes parity with the other 2 zfs acl testcases (01, 03).
2016-09-18 03:00:46 +00:00
ngie
5eea13f3b8 MFstable/11 r305910:
MFC r305033,r305041,r305170:

r305033:

Minor Makefile simplifications for lib/atf/...

- Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP}
- Use built-in :H operator instead of ".." when enumerating paths.

r305041:

Filter certain compile-time options into -DATF_BUILD_*

Items filtered through are:

- Constant defines (-D)
- Include flags (-I)
- Linker flags (-L)
- Optimization level (-O)
- Warnings / linker flags (-W)
- Preprocessor options (-f)

This fixes the scenario hit by the Jenkins job where it's infecting
the build with --sysroot, etc options from the Jenkins build in the
tests.

Prefix all intermediate variables (_CFLAGS, etc) with "ATF_BUILD" [*].

Requested by:	jmmv

r305170:

Don't bake all of CC/CPP/CXX into CFLAGS

Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).
2016-09-18 02:51:18 +00:00
hiren
6d45a159b0 MFC r301522 (by bz)
Implement a `show panic` command to DDB which will helpfully print the
panic string again if set, in case it scrolled out of the active
window.  This avoids having to remember the symbol name.

Also add a show callout <addr> command to DDB in order to inspect
some struct callout fields in case of panics in the callout code.
This may help to see if there was memory corruption or to further
ease debugging problems.

No objection by:    bz
2016-09-16 00:14:26 +00:00
hselasky
0042789fce MFC r305590:
Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR:		170358
2016-09-15 08:35:46 +00:00
kib
8628e8e910 MFC r305744:
Fix typo in comment.
2016-09-15 08:26:59 +00:00
kib
6a85dd3622 MFC r305129:
Make swapoff reliable.
2016-09-14 10:51:06 +00:00
mav
2932b17b57 MFC r305123: Fix kernel panic when inheriting properties without default.
There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.
2016-09-14 09:13:17 +00:00
mav
b536ad3bd8 MFC r305536: Fix channel initialization in FBS mode.
Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
MFC r305536: Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
port multipliers used on FBS-capable HBAs (Marvell).
2016-09-14 09:11:03 +00:00
mav
693cfd5203 MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().
Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data.  On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.
2016-09-13 09:25:38 +00:00
lwhsu
1e561bde87 MFC r303935
Only remove empty directories before packaging.

This preserves files are intentionally empty, most of them are in tests.txz

Reviewed by:	bdrewery
2016-09-13 05:22:08 +00:00
mm
7cdb4294a8 MFC r305422:
Sync libarchive with vendor

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This includes a bugfix for a bug that caused ACLs not to be read properly
for files and directories inside subdirectories and as a result not being
stored or being incorrectly stored in tar archives.
2016-09-12 22:07:35 +00:00
asomers
9f16b96c4b MFC r302778
pw should sanitize the argument of -w.

Otherwise, it will silently disable the login for the selected account if
the argument is unrecognizable.

usr.sbin/pw/pw.h
usr.sbin/pw/pw_conf.c
usr.sbin/pw/pw_user.c
        Use separate rules to validate boolean parameters and passwd
        parameters.  Error out if a password parameter cannot be parsed.

usr.sbin/pw/tests/Makefile
usr.sbin/pw/tests/crypt.c
usr.sbin/pw/tests/pw_useradd.sh
usr.sbin/pw/tests/pw_usermod.sh
        Add tests for the validation.  Also, enhance existing
        password-related tests to actually validate that the correct hash is
        written to master.passwd.
2016-09-12 17:35:45 +00:00
gnn
5986af9d01 MFC: 304825
Unlike Solaris, in FreeBSD p_args can be 0 so check for that
instead of walking down to ar_args blindly.

Reported by:	Amanda Strnad
Reviewed by:	markj, jhb
Sponsored by:	DARPA, AFRL
2016-09-12 17:05:42 +00:00
asomers
438ab6eea8 MFC r304162
Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour

24 hours is too long. Periodic scripts are executed serially, so when
combined with the sleep in 410.pkg-audit periodic could actually take more
than 24 hours and block the next invocation.
2016-09-12 16:55:16 +00:00
hselasky
9a6fa1e8fe MFC r305421:
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by:	avos@
2016-09-12 10:17:25 +00:00
sephe
5588186dae MFC 305177
net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

    Reviewed by:    araujo, hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7710
2016-09-12 08:32:06 +00:00
dim
047867ccca MFC r305430:
Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.
2016-09-11 14:19:06 +00:00
jhb
2c4c5ee1df MFC 303720: Apply the fix from r232612 to fixed function counters. 2016-09-09 21:19:31 +00:00
jhb
7380cda6f5 MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().
PR:		208168
2016-09-09 20:30:36 +00:00
jhb
a40f879158 MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
Move msix_disable_migration under #ifdef SMP since it doesn't make sense
for !SMP kernels.

PR:		212014
2016-09-09 19:57:32 +00:00
delphij
9182c7d232 MFC r305469:
Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by:	allanjude, emaste
2016-09-09 06:59:49 +00:00
hselasky
2442d6725d MFC r304571:
Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.
2016-09-09 06:38:13 +00:00
hselasky
e7f04cd3bd MFC r305284:
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.
2016-09-09 06:27:25 +00:00
pfg
2055a39258 MFC r303893, r303894:
misc replacements of comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.
2016-09-08 15:27:42 +00:00
pfg
87eef91d29 MFC r303889:
libc/rpc: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.
2016-09-08 15:12:55 +00:00
pfg
1061080342 MFC r303891, r303892:
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.
2016-09-08 15:06:28 +00:00
hselasky
9a13035421 MFC r281499:
Modify the return value of the uhci/ehci/xhci PCI probe routines to
'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership
of the device and pass it through to the guest.

In the common case where there are no competing drivers for USB controllers
this change is a no-op.

PR:		212256
2016-09-08 09:50:03 +00:00
ache
11eb45c087 MFC r305413
Fix error handling.
2016-09-08 07:14:48 +00:00
ache
56ade7a489 MFC r305406,r305409,r305412
1) Fix errors handling.

2) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.
2016-09-08 05:13:50 +00:00
jilles
595191c4ea MFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.
In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, although readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.
2016-09-07 21:09:44 +00:00
jilles
87621d8c31 MFC r305090: getvfsbyname(3): Remove [EFAULT] error.
Since r101651 in 2002, getvfsbyname() has written *vfc using userland
memcpy(), so the [EFAULT] error no longer occurs.
2016-09-07 21:04:39 +00:00
dim
be91514db3 MFC r305389:
With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D7777
2016-09-07 19:25:08 +00:00
dim
83216cdbb7 MFC r305388:
With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by:	imp, hselasky
Differential Revision: https://reviews.freebsd.org/D7776
2016-09-07 19:21:52 +00:00
dim
5af3f0b5e8 MFC r305360:
With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by:	np
Differential Revision: https://reviews.freebsd.org/D7772
2016-09-07 19:17:03 +00:00
dim
2df99ac12a MFC r305345:
With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
	if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
		     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
		if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
		    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
					nACK | SELECT | PERROR | nBUSY)) {
					~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D7771
2016-09-07 19:02:47 +00:00
dim
5fce709aa8 MFC r305344:
Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D7770
2016-09-07 18:53:46 +00:00
dim
da0e73d492 MFC r305085:
Fix warnings in tnftp about invalid constant conversions, e.g.:

contrib/tnftp/src/ftp.c:2067:11: error: implicit conversion from 'int'
to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
        buf[0] = IAC;
               ~ ^~~
/usr/include/arpa/telnet.h:39:13: note: expanded from macro 'IAC'
#define IAC     255             /* interpret as command: */
                ^~~
contrib/tnftp/src/ftp.c:2068:11: error: implicit conversion from 'int'
to 'char' changes value from 244 to -12 [-Werror,-Wconstant-conversion]
        buf[1] = IP;
               ~ ^~
/usr/include/arpa/telnet.h:50:12: note: expanded from macro 'IP'
#define IP      244             /* interrupt process--permanently */
                ^~~

Use an unsigned char buffer instead.
2016-09-07 18:33:18 +00:00
dim
aedf985ec0 MFC r305077:
Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey.  This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC r305086:

Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
		*lsrp++ = IPOPT_SSRR;
			~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR              137             /* strict source route */
				^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
		*lsrp++ = IPOPT_LSRR;
			~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR              131             /* loose source route */
				^~~

Use unsigned char buffers instead.
2016-09-07 18:22:08 +00:00
emaste
5c6abe41ac Regen after r305518: Allow getdtablesize in capability mode 2016-09-07 04:07:43 +00:00
emaste
33cdd4c4c4 MFC r305140: Allow getdtablesize in capability mode 2016-09-07 04:06:25 +00:00
pfg
3fae70ce81 MFC r303799, r303800:
ext2fs:	Add defines for some missing ext4 features and inode flags.

These are currently unused in our implementation and some even appear to
have not been implemented yet on linux but it is good to keep them for
reference.

Obtained from:	NetBSD
2016-09-06 19:53:05 +00:00
davidcs
cf073edeab MFC 304249
Add support for set/get cam search mode
2016-09-06 19:29:14 +00:00
davidcs
855215474e MFC r394247
Upgrade fw, bootloader and minidump template to version 5.4.58
    Add minidump retrieval code

MFC r394248
    Add ql_minidump.h
2016-09-06 19:27:00 +00:00
avg
0ecb086e4a MFC r304674: intpm: add support for SB800 2016-09-06 06:25:10 +00:00
avg
85a18b06ff MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
mount filesystem
2016-09-06 06:17:39 +00:00
avg
f531fd05da MFC r303738: report sector size and number of sectors in lsdev output
for bios disks
2016-09-06 06:13:47 +00:00
ache
ca95b01236 MFC r305365
The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)
2016-09-06 00:32:33 +00:00
emaste
6da7f85311 MFC r305269: cron: use existing maximum username constant MAXLOGNAME
Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR:		212305
Reported by:	Andrii Kuzik
2016-09-05 15:50:40 +00:00
ache
23cf012b28 MFC r305241
fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
sequence near EOF), so we can't just check for
(wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with
__SERR clearing/restoring.
2016-09-05 01:57:32 +00:00