]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC: 304825
gnn [Mon, 12 Sep 2016 17:02:22 +0000 (17:02 +0000)]
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

7 years agoMFC r304162
asomers [Mon, 12 Sep 2016 16:36:44 +0000 (16:36 +0000)]
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.

7 years agoMFC r302778
asomers [Mon, 12 Sep 2016 16:28:32 +0000 (16:28 +0000)]
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.

7 years agoMFC r305421:
hselasky [Mon, 12 Sep 2016 10:14:30 +0000 (10:14 +0000)]
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@

7 years agoMFC 305177
sephe [Mon, 12 Sep 2016 08:14:11 +0000 (08:14 +0000)]
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

7 years agoMFC r305061
grehan [Mon, 12 Sep 2016 00:24:56 +0000 (00:24 +0000)]
MFC r305061
    Invert calloc(3) argument order

7 years agoMFC r303352
grehan [Mon, 12 Sep 2016 00:21:55 +0000 (00:21 +0000)]
MFC r303352
    - Change the fbuf "vga" parameter to "vga=on|io|off".
       "io" is the default, and allows VGA i/o registers to be
       accessed. This is required by Win7/2k8 graphics guests that
       use a combination of BIOS int10 and UEFI.
       "off" disables all VGA i/o and mem accesses.
       "on" is not yet hooked up, but will enable full VGA rendering.

       OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off"

    - Allow "rfb" to be used instead of "tcp" for the fbuf VNC
      description. "tcp" will be removed at a future point and is
      kept as an alias.

7 years agoMFC r302972,r303349
grehan [Mon, 12 Sep 2016 00:16:26 +0000 (00:16 +0000)]
MFC r302972,r303349

r302972
    Disallow interrupt requests on disabled endpoints.

r303349
    Catch another case where an XHCI interrupt was being
    injected without state being set up.

7 years agoMFC r302546
grehan [Mon, 12 Sep 2016 00:03:14 +0000 (00:03 +0000)]
MFC r302546
    Implement right shift/ctl, and convert the VNC/xorg scancode
    of 0xff03 into right-alt.

7 years agoMFC r305430:
dim [Sun, 11 Sep 2016 14:19:06 +0000 (14:19 +0000)]
MFC r305430:

Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.

7 years agoMFC r305575:
kevlo [Sun, 11 Sep 2016 07:24:12 +0000 (07:24 +0000)]
MFC r305575:

In m_devget(), if the data fits in a packet header mbuf, check the amount
of data is less than or equal to MHLEN instead of MLEN when placing initial
small packet header at end of mbuf.

Reviewed by: glebius

7 years agoMFC 303720: Apply the fix from r232612 to fixed function counters.
jhb [Fri, 9 Sep 2016 21:19:31 +0000 (21:19 +0000)]
MFC 303720: Apply the fix from r232612 to fixed function counters.

7 years agoMFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().
jhb [Fri, 9 Sep 2016 20:30:36 +0000 (20:30 +0000)]
MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().

PR: 208168

7 years agoMFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
jhb [Fri, 9 Sep 2016 19:57:32 +0000 (19:57 +0000)]
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

7 years agoMFC r305469:
delphij [Fri, 9 Sep 2016 06:59:01 +0000 (06:59 +0000)]
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

7 years agoMFC r304571:
hselasky [Fri, 9 Sep 2016 06:36:43 +0000 (06:36 +0000)]
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.

7 years agoMFC r305284:
hselasky [Fri, 9 Sep 2016 06:25:40 +0000 (06:25 +0000)]
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.

7 years agoMFC r303893, r303894:
pfg [Thu, 8 Sep 2016 15:25:41 +0000 (15:25 +0000)]
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.

7 years agoMFC r303889:
pfg [Thu, 8 Sep 2016 15:12:20 +0000 (15:12 +0000)]
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.

7 years agoMFC r303891, r303892:
pfg [Thu, 8 Sep 2016 15:05:25 +0000 (15:05 +0000)]
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.

7 years agoMFC r305413
ache [Thu, 8 Sep 2016 07:16:15 +0000 (07:16 +0000)]
MFC r305413

Fix error handling.

7 years agoMFC r305406,r305409,r305412
ache [Thu, 8 Sep 2016 06:53:18 +0000 (06:53 +0000)]
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.

7 years agoMFC r305492: Let knlist_add do the locking part
gonzo [Wed, 7 Sep 2016 23:36:46 +0000 (23:36 +0000)]
MFC r305492: Let knlist_add do the locking part

Remove explicit mtx_lock/mtx_unlock around knlist_add and pass 0 as
locked parameter so knlist_add does the locking itself

Suggested by:   kib@

7 years agoMFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.
jilles [Wed, 7 Sep 2016 21:03:11 +0000 (21:03 +0000)]
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.

7 years agoMFC r305090: getvfsbyname(3): Remove [EFAULT] error.
jilles [Wed, 7 Sep 2016 21:01:32 +0000 (21:01 +0000)]
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.

7 years agoMFC r305396:
dim [Wed, 7 Sep 2016 19:29:15 +0000 (19:29 +0000)]
MFC r305396:

Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header.  This
value is used in newer versions of compiler-rt.

7 years agoMFC r305389:
dim [Wed, 7 Sep 2016 19:25:08 +0000 (19:25 +0000)]
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

7 years agoMFC r305388:
dim [Wed, 7 Sep 2016 19:21:52 +0000 (19:21 +0000)]
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

7 years agoMFC r305360:
dim [Wed, 7 Sep 2016 19:17:03 +0000 (19:17 +0000)]
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

7 years agoMFC r305345:
dim [Wed, 7 Sep 2016 19:02:47 +0000 (19:02 +0000)]
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

7 years agoMFC r305344:
dim [Wed, 7 Sep 2016 18:53:46 +0000 (18:53 +0000)]
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

7 years agoMFC r305085:
dim [Wed, 7 Sep 2016 18:33:18 +0000 (18:33 +0000)]
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.

7 years agoMFC r305077:
dim [Wed, 7 Sep 2016 18:22:08 +0000 (18:22 +0000)]
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.

7 years agoMFC r305218:
dim [Wed, 7 Sep 2016 18:16:06 +0000 (18:16 +0000)]
MFC r305218:

Pull in r277331 from upstream llvm trunk (by Diana Picus):

  [AArch64] Return the correct size for TLSDESC_CALLSEQ

  The branch relaxation pass is computing the wrong offsets because it assumes
  TLSDESC_CALLSEQ eats up 4 bytes, when in fact it is lowered to an instruction
  sequence taking up 16 bytes. This can become a problem in huge files with lots
  of TLS accesses, as it may slowly move branch targets out of the range computed
  by the branch relaxation pass.

  Fixes PR24234 https://llvm.org/bugs/show_bug.cgi?id=24234

  Differential Revision: https://reviews.llvm.org/D22870

This fixes "error in backend: fixup value out of range" when compiling
the misc/talkfilters port for AArch64.

Reported by: sbruno
PR: 201762

7 years agoMFC r304920:
dim [Wed, 7 Sep 2016 18:06:34 +0000 (18:06 +0000)]
MFC r304920:

In ncurses baudrate definitions, avoid warnings about implicit
conversions from int to short changing the values.  This applies to
B38400 and higher, since their values do not fit into a short.

However, since the wrapped values are still unique, and they only serve
as keys, there is no problem in adding a cast to silence the warnings.
This also avoids changing the ABI, which would happen if we changed
NCURSES_OSPEED to int.

Discussed with: Thomas Dickey

7 years agoMFC 303299, 303475:
andrew [Wed, 7 Sep 2016 16:08:36 +0000 (16:08 +0000)]
MFC 303299, 303475:
 - Enable the generic OHCI driver on arm64
 - Add a generic EHCI USB driver based on the Allwinner A10 driver

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303592:
andrew [Wed, 7 Sep 2016 16:00:37 +0000 (16:00 +0000)]
MFC 303592:
Extract the common parts of pmap_kenter_device to a new function

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303585, 303587:
andrew [Wed, 7 Sep 2016 15:37:39 +0000 (15:37 +0000)]
MFC 303585, 303587:
 - Relax the barriers around a TLB invalidation
 - Fix the comment above pmap_invalidate_page

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304279:
kib [Wed, 7 Sep 2016 14:01:58 +0000 (14:01 +0000)]
MFC r304279:
By default, allow all to read the HPET registers pages.  At the same
time, by, by default disallow writes to the mmaped HPET pages.

7 years agoMFC 304801:
andrew [Wed, 7 Sep 2016 13:57:06 +0000 (13:57 +0000)]
MFC 304801:
  Don't set *dev in the zfs root case, it may be NULL and will correctly be
  set later in the function. This fixes a potential NULL pointer dereference
  found on arm64.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303594, 303610:
andrew [Wed, 7 Sep 2016 13:16:21 +0000 (13:16 +0000)]
MFC 303594, 303610:
 Add more AArch64 special register macros

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 304625:
andrew [Wed, 7 Sep 2016 13:10:02 +0000 (13:10 +0000)]
MFC 304625:
 Fix the arm64 non-SMP build.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303307, 303308, 303309 clean up the arm64 MP code:
andrew [Wed, 7 Sep 2016 12:59:08 +0000 (12:59 +0000)]
MFC 303307, 303308, 303309 clean up the arm64 MP code:
 - Rework how we number CPUs on arm64 to try and keep clusters together.
 - Fix a typo in a string in a KASSERT to sanity check the CPU IDs.
 - Remove an unused variable.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303661:
andrew [Wed, 7 Sep 2016 12:33:04 +0000 (12:33 +0000)]
MFC 303661:
 Remove trailing whitespace from the arm64 pmap

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC 304140:
andrew [Wed, 7 Sep 2016 12:28:30 +0000 (12:28 +0000)]
MFC 304140:
 Add the ARMv8.1 identification registers to the list we print when booting.

Sponsored by: ABT Systems Ltd

7 years agoMFC 302849, 302851, 302896 GICv3 improvements:
andrew [Wed, 7 Sep 2016 12:10:30 +0000 (12:10 +0000)]
MFC 302849, 302851, 302896 GICv3 improvements:
 - Move internal data structures out of the common header file
 - Remove unused data structures and macros
 - Add us_print_child to the GICv3 driver

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoMFC r305171: allow kern.proc.nfds sysctl in capability mode
emaste [Wed, 7 Sep 2016 03:15:26 +0000 (03:15 +0000)]
MFC r305171: allow kern.proc.nfds sysctl in capability mode

7 years agoRegen after r305514, allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 02:54:40 +0000 (02:54 +0000)]
Regen after r305514, allow getdtablesize in capability mode

7 years agoMFC r305140: Allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 02:53:38 +0000 (02:53 +0000)]
MFC r305140: Allow getdtablesize in capability mode

7 years agoMFC r303799, r303800:
pfg [Tue, 6 Sep 2016 19:51:24 +0000 (19:51 +0000)]
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

7 years agoMFC 304249
davidcs [Tue, 6 Sep 2016 19:18:50 +0000 (19:18 +0000)]
MFC 304249
  Add support for set/get cam search mode

7 years agoMFC r394247
davidcs [Tue, 6 Sep 2016 19:15:44 +0000 (19:15 +0000)]
MFC r394247
  Upgrade fw, bootloader and minidump template to version 5.4.58
  Add minidump retrieval code

MFC r394248
  Add ql_minidump.h

7 years agoMFC r305065: Add refactored blacklist support to sshd
lidl [Tue, 6 Sep 2016 14:52:14 +0000 (14:52 +0000)]
MFC r305065: Add refactored blacklist support to sshd

Change the calls to of blacklist_init() and blacklist_notify to be
macros defined in the blacklist_client.h file.  This avoids
the need for #ifdef USE_BLACKLIST / #endif except in the
blacklist.c file.

Remove redundent initialization attempts from within
blacklist_notify - everything always goes through
blacklistd_init().

Added UseBlacklist option to sshd, which defaults to off.
To enable the functionality, use '-o UseBlacklist=yes' on
the command line, or uncomment in the sshd_config file.

Approved by: des
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304674: intpm: add support for SB800
avg [Tue, 6 Sep 2016 06:22:27 +0000 (06:22 +0000)]
MFC r304674: intpm: add support for SB800

7 years agoMFC r304520: fix bug introduced in r297521, set canmount=on doesn't
avg [Tue, 6 Sep 2016 06:17:34 +0000 (06:17 +0000)]
MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
mount filesystem

7 years agoMFC r303738: report sector size and number of sectors in lsdev output
avg [Tue, 6 Sep 2016 06:13:36 +0000 (06:13 +0000)]
MFC r303738: report sector size and number of sectors in lsdev output
for bios disks

7 years agoMFC r305265:
kevlo [Tue, 6 Sep 2016 01:10:51 +0000 (01:10 +0000)]
MFC r305265:

Revert r304192 to fix short month names and replace %b with %_m in date_fmt
for Chinese locales.

As mentioned in the commit message of r289041, nl_langinfo(ABMON_*) only
returned numbers when using a Chinese locale, this causes problems in
applications that put the short month name and the day of the month together.

Spotted by: Ting-Wei Lan <lantw44 gmail com>

7 years agoMFC r305365
ache [Tue, 6 Sep 2016 00:33:54 +0000 (00:33 +0000)]
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)

7 years agoMFC r304102
alc [Mon, 5 Sep 2016 23:56:27 +0000 (23:56 +0000)]
MFC r304102
  Eliminate unneeded vm_page_xbusy() and vm_page_xunbusy() operations when
  neither vm_pager_has_page() nor vm_pager_get_pages() is called.

7 years agoMFC r304509
manu [Mon, 5 Sep 2016 21:25:45 +0000 (21:25 +0000)]
MFC r304509

if_emac: Before generating a random MAC address, try using the SID rootkey
to generate one. This is was U-Boot does to generate a random MAC so we end
up with the same MAC address as if U-Boot did generate it.

7 years agoMFC r303087
manu [Mon, 5 Sep 2016 21:11:27 +0000 (21:11 +0000)]
MFC r303087

Add support for the SID (Security ID Module) on Allwinner A10 and A20.
The rootkey is burnt at production and can't be changed, thus is can be used
as a device unique ID or to generate a MAC address (This is was u-boot does).
The rootkey is exposed as a sysctl (dev.aw_sid.<unit>.rootkey).

Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D6383

7 years agoMFC r304290,r304649
manu [Mon, 5 Sep 2016 20:46:45 +0000 (20:46 +0000)]
MFC r304290,r304649

r304290:
Only set pud settings if this is a pullup or pulldown configuration.
This removes the need to set the MMC pins with pullups in our DTS.
Thanks to jmcneill@ for spotting this.

r304649:
Do not include file from dt-bindings and simply use the already present defines.

7 years agoMFC r304289
manu [Mon, 5 Sep 2016 20:34:15 +0000 (20:34 +0000)]
MFC r304289

a10_gpio_get_function now returns the whole function not only
GPIO_INPUT/GPIO_OUTPUT.
a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP.
Add a10_gpio_get_drv to get the current drive strenght.
During fdt pin configure, avoid setting function/drive/pud if it's already in
the correct value.

Tested on Allwinner H3 and A20

7 years agoMFC r303186
manu [Mon, 5 Sep 2016 20:29:04 +0000 (20:29 +0000)]
MFC r303186
PC5 doesn't have mmc2 function.

7 years agoMFC r302472
manu [Mon, 5 Sep 2016 20:17:18 +0000 (20:17 +0000)]
MFC r302472
Add support for Allwinner A13.

Reviewed by: jmcneill
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6809

7 years agoMFC r302470
manu [Mon, 5 Sep 2016 20:07:03 +0000 (20:07 +0000)]
MFC r302470
Check that the pin function exists before setting it.
This is needed for Allwinner A13 which has gpio pins with only "out" function.

7 years agoMFC r305269: cron: use existing maximum username constant MAXLOGNAME
emaste [Mon, 5 Sep 2016 15:43:22 +0000 (15:43 +0000)]
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

7 years agoMFC r305241
ache [Mon, 5 Sep 2016 02:00:35 +0000 (02:00 +0000)]
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.

7 years agoMFC r305144
ache [Mon, 5 Sep 2016 00:41:17 +0000 (00:41 +0000)]
MFC r305144

'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com

7 years agoMFC 304222
manu [Sun, 4 Sep 2016 08:53:58 +0000 (08:53 +0000)]
MFC 304222

Only use WaitForKeys event if it exists, this is not the case in u-boot efi implementation.

7 years agoMFC 304221 and 304271
manu [Sun, 4 Sep 2016 08:52:09 +0000 (08:52 +0000)]
MFC 304221 and 304271

Use %ju modifier for u_int64_t and %jd modifier for off_t.
off_t is long long on arm32 and long on amd64

Correctly print and cast u_int64_t and off_t.

7 years agoMFC r305219
ache [Sun, 4 Sep 2016 00:35:55 +0000 (00:35 +0000)]
MFC r305219

If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().

7 years agoMFC r305015:
kib [Sat, 3 Sep 2016 09:24:33 +0000 (09:24 +0000)]
MFC r305015:
Remove commented out mention of ptrace.S.

7 years agoMFC r304928:
kib [Sat, 3 Sep 2016 09:03:40 +0000 (09:03 +0000)]
MFC r304928:
Do not obliterate errno value in the main thread during ptrace(2) call on x86.

MFC r304931:
Follow ABI when calling __error from the ptrace(2) wrapper.

MFC r305012:
Rewrite ptrace(2) wrappers in C.

MFC r305022:
Restore the requirement of setting errno to zero before calling ptrace(2).

7 years agoMFC r305133
ache [Sat, 3 Sep 2016 01:09:22 +0000 (01:09 +0000)]
MFC r305133

Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.

7 years agoMFC r305104:
gonzo [Fri, 2 Sep 2016 22:13:19 +0000 (22:13 +0000)]
MFC r305104:

Update VCHIQ driver to upstream version 4eda74f2

PR: 211525
Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com>

7 years agoMFC r305039:
gonzo [Fri, 2 Sep 2016 22:04:20 +0000 (22:04 +0000)]
MFC r305039:

Fix TI PRUSS driver panic with INVARIANTS enabled

Value passed as islocked argument to knlist_add should
be consistent with actual lock state so add lock/unlock
calls around knlist_add

PR: 212120
Submitted by: Manuel Stuhn

7 years agoMFC r305023:
dim [Fri, 2 Sep 2016 17:24:16 +0000 (17:24 +0000)]
MFC r305023:

Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned.

7 years agoMFC r305013:
dim [Fri, 2 Sep 2016 17:07:52 +0000 (17:07 +0000)]
MFC r305013:

Add an empty virtual destructor to zfsd's Vdev class.  This is needed
because the class has virtual functions, and the compiler-generated
default destructor is non-virtual.

Reviewed by: asomers

MFC r305016:

Fix the zfsd unittest:
* TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin
* DevdCtl::EventBuffer no longer exists, so remove its forward
  declaration

7 years agoMFC r303576:
ngie [Fri, 2 Sep 2016 04:06:44 +0000 (04:06 +0000)]
MFC r303576:

Conditionalize code which defines sysctls per _KERNEL #ifdef guard

This resolves several issues when compiling libzpool (userspace library), i.e.
-Wimplicit-function-declaration and -Wmissing-declarations issues.

Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0

7 years agoMFC r305108,305109:
nwhitehorn [Thu, 1 Sep 2016 22:27:47 +0000 (22:27 +0000)]
MFC r305108,305109:
Refix operation on sparse CPU mappings as in r302372, temporarily broken
by r304716.

PR: kern/210106

7 years agoMFC r305036:
nwhitehorn [Thu, 1 Sep 2016 22:24:30 +0000 (22:24 +0000)]
MFC r305036:
Some versions of SLOF do not append the partition number to the boot
device argument to the stage-1 bootloader. In such cases, boot1 would
only try to read the entire device rather than checking for partitions.
Instead of panic'ing, fall back to reading the partitions as normal in
such situations. This was preventing boot of installed systems on some
versions of PowerKVM.

PR: kern/211599

7 years agoMFC r304966 (peter):
gjb [Thu, 1 Sep 2016 19:30:52 +0000 (19:30 +0000)]
MFC r304966 (peter):
 The read-ahead code from r298230 made it likely the boot code would read
 beyond the end of disk. r298900 added code to prevent this.  Some BIOSes
 cause significant delays if asked to read past end-of-disk.

 We never trusted the BIOS to accurately report the sectorsize of disks
 before and this set of changes.  Unfortuately they interact badly with
 the infamous >2TB wraparound bugs.  We have a number of relatively-recent
 machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB.

 With pre-r298900 they work just fine.  After r298900 they stop working if
 the boot environment attempts to access anything outside the first 1TB on
 the disk.  'ZFS: I/O error, all block copies unavailable' etc.  It affects
 both UFS and ZFS if they try to boot from large volumes.

 This change replaces the blind trust of the BIOS end-of-disk reporting
 with a read-ahead clip to prevent reads crossing the of end-of-disk
 boundary.  Since 2^32 (2TB) size reporting truncation is not uncommon,
 the clipping is done on 2TB aliases of the reported end-of-disk.
 ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ...
 as one of them is likely to be the real end-of-disk.

 This should make the loader on these broken machines behave the same as
 traditional pre-r298900 loader behavior, without disabling read-ahead.

PR: 212139
Sponsored by: The FreeBSD Foundation

7 years agoMFC r304809:
ngie [Thu, 1 Sep 2016 19:00:30 +0000 (19:00 +0000)]
MFC r304809:

Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs

It's not necessarily intuitive that the variables to query contain TRUSTEDBSD
in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like
"_PC_ACL_NFS4".

Relnotes: yes

7 years agoMFC r303573:
ngie [Thu, 1 Sep 2016 18:56:42 +0000 (18:56 +0000)]
MFC r303573:

Cast result from third parameter to int instead of promoting it to size_t

This resolves a -Wformat issue when the value is used as a format width
precision specifier, i.e. %*s

7 years agoMFC r304075,r304989:
mm [Thu, 1 Sep 2016 07:53:59 +0000 (07:53 +0000)]
MFC r304075,r304989:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744: Very long pathnames evade symlink checks
Issue #748: libarchive can compress, but cannot decompress zip some files
PR #750: ustar: fix out of bounds read on empty string ("") filename
PR #755: fix use of acl_get_flagset_np() on FreeBSD
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC r304874:
Temporarily disable two libarchive tests that have not yet been fixed by
vendor. Tests will be re-enabled after a fix has been merged.

7 years agoMFC 304202
sephe [Thu, 1 Sep 2016 07:41:49 +0000 (07:41 +0000)]
MFC 304202
    tcp/lro: Make # of LRO entries tunable

    Reviewed by:    hps, gallatin
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7499

7 years agoMFC r305024:
kib [Thu, 1 Sep 2016 07:19:04 +0000 (07:19 +0000)]
MFC r305024:
Typesetting fixes.

7 years agoMFC r304812:
kib [Thu, 1 Sep 2016 07:15:23 +0000 (07:15 +0000)]
MFC r304812:
In both do_rw_wrlock() and do_rw_rdlock(), do not obliterate possible
error from sleep.

7 years agoMFC r304808:
kib [Thu, 1 Sep 2016 07:08:01 +0000 (07:08 +0000)]
MFC r304808:
Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.

PR: 211947

7 years agoMFC r304652:
badger [Wed, 31 Aug 2016 22:18:50 +0000 (22:18 +0000)]
MFC r304652:

Fix missing substitution of @SBINDIR@ in resolvconf scripts

Certain features, such as resolv_conf_passthrough=NULL, do not work
correctly due to this missing substitution.

Also remove the @PREFIX@ substitution, which is no longer needed.

Approved by: vangyzen (mentor)
Sponsored by: Dell Inc.

7 years agoMFC r303855:
markj [Wed, 31 Aug 2016 21:35:12 +0000 (21:35 +0000)]
MFC r303855:
Handle races with listening socket close when connecting a unix socket.

PR: 211531

7 years agoMFC r304053, r304054:
markj [Wed, 31 Aug 2016 21:14:16 +0000 (21:14 +0000)]
MFC r304053, r304054:
Initialize busy lock state and strengthen busy lock assertions.

7 years agoMFC: r304638, r304640
jkim [Wed, 31 Aug 2016 20:33:59 +0000 (20:33 +0000)]
MFC: r304638, r304640

Fix white spaces and prefer C-style comments in assembly sources.

7 years agoMFC: r304636
jkim [Wed, 31 Aug 2016 20:30:49 +0000 (20:30 +0000)]
MFC: r304636

Build OpenSSL assembly sources for arm.

7 years agoMFC r304315 (by jilles):
kib [Wed, 31 Aug 2016 20:25:37 +0000 (20:25 +0000)]
MFC r304315 (by jilles):
rights(4): CAP_FSYNC also permits fdatasync(2).

7 years agoMFC: r304320
jkim [Wed, 31 Aug 2016 20:21:03 +0000 (20:21 +0000)]
MFC: r304320

Disable assembly sources when compiler/assembler cannot compile certain
instructions.  For example, GCC 4.2.1 + binutils 2.17.50 does not support
AVX instructions.

7 years agoMFC r304969:
dim [Wed, 31 Aug 2016 18:37:04 +0000 (18:37 +0000)]
MFC r304969:

Define hastd's STRICT_ALIGN macro in a defined and portable way.

7 years agoMFC r304953:
dim [Wed, 31 Aug 2016 18:00:41 +0000 (18:00 +0000)]
MFC r304953:

Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D7671

MFC r304959 (by kib):

Complete r304953.

Sponsored by: The FreeBSD Foundation

MFC r304964:

Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to: dim

7 years agoMFC 302847, 302848, 302852, 302853:
andrew [Wed, 31 Aug 2016 17:36:43 +0000 (17:36 +0000)]
MFC 302847, 302848, 302852, 302853:
Remove the remaining non-INTRNG support from the arm64 code.