]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoUpdate llvm to trunk r290819 and resolve conflicts.
Dimitry Andric [Mon, 2 Jan 2017 21:25:48 +0000 (21:25 +0000)]
Update llvm to trunk r290819 and resolve conflicts.

7 years agoMake native-xtools build correctly after clang/llvm 3.9.0 import
Dimitry Andric [Mon, 2 Jan 2017 19:33:22 +0000 (19:33 +0000)]
Make native-xtools build correctly after clang/llvm 3.9.0 import

During the clang/llvm 3.9.0 import, the build structure for it was
completely revamped.  This broke the native-xtools target.

It first attempts to build libllvmminimal, then the llvm-tblgen and
clang-tblgen executables, but these fail to link because they are linked
to the 'full' libllvm by default, as they normally are during the
'world' stage.

To make these link against libllvmminimal instead, define TOOLS_PREFIX,
similarly as during the bootstrap-tools phase.  The value itself is
empty, as we don't really want to use a prefix.

Reviewed by: imp
PR: 215684
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9026

7 years agoWorkaround NFS bug with readdirplus when there are greater than 1 billion files in...
Josh Paetzel [Mon, 2 Jan 2017 19:18:56 +0000 (19:18 +0000)]
Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem.

Reviewed by kib
MFC after: 2 weeks
Sponsored by: iXsystems
Differential Revision: D9009

7 years agoVendor import of llvm trunk r290819:
Dimitry Andric [Mon, 2 Jan 2017 19:17:04 +0000 (19:17 +0000)]
Vendor import of llvm trunk r290819:
https://llvm.org/svn/llvm-project/llvm/trunk@290819

7 years agoConditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS
Enji Cooper [Mon, 2 Jan 2017 19:03:01 +0000 (19:03 +0000)]
Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS
if MK_GSSAPI != "no"

MFC after: 1 week

7 years agoBuild libexec/kadmind when MK_GSSAPI != no because it requires gssapi
Enji Cooper [Mon, 2 Jan 2017 19:02:00 +0000 (19:02 +0000)]
Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi

MFC after: 1 week

7 years agoThere is no need to use temporary statfs buffer for fsid obliteration
Konstantin Belousov [Mon, 2 Jan 2017 18:59:23 +0000 (18:59 +0000)]
There is no need to use temporary statfs buffer for fsid obliteration
and prison enforcement.  Do it on the caller buffer directly.

Besides eliminating memory copies, this change also removes large
structure from the kernel stack.

Extracted from: ino64 work by gleb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agolibgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize
Enji Cooper [Mon, 2 Jan 2017 18:58:13 +0000 (18:58 +0000)]
libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize
their building on the knob

MFC after: 1 week

7 years agoStyle.
Konstantin Belousov [Mon, 2 Jan 2017 18:49:48 +0000 (18:49 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agopatch(1): replace strnlen() with a simpler strlen().
Pedro F. Giffuni [Mon, 2 Jan 2017 18:27:35 +0000 (18:27 +0000)]
patch(1): replace strnlen() with a simpler strlen().

Small style fix with here.

Pointed out by: kib

7 years agoRevert r311106:
Pedro F. Giffuni [Mon, 2 Jan 2017 18:23:31 +0000 (18:23 +0000)]
Revert r311106:
patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.

This doesn't really work for 32 bit platforms.

Pointed out by: kib

7 years agoMove common code from kern_statfs() and kern_fstatfs() into a new helper.
Konstantin Belousov [Mon, 2 Jan 2017 18:20:22 +0000 (18:20 +0000)]
Move common code from kern_statfs() and kern_fstatfs() into a new helper.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agopatch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.
Pedro F. Giffuni [Mon, 2 Jan 2017 17:12:14 +0000 (17:12 +0000)]
patch(1): extend the maximum length of a line from USHRT_MAX to UINT_MAX.

We can handle such "big data" without much trouble.
Try to do a better job at detecting the rejection cause while here.

MFC after: 2 weeks

7 years agorsu: restore 40Mhz channel support.
Andriy Voskoboinyk [Mon, 2 Jan 2017 16:58:55 +0000 (16:58 +0000)]
rsu: restore 40Mhz channel support.

MFC after: 4 days.

7 years agoPrint flags in hex instead of decimal.
Justin Hibbits [Mon, 2 Jan 2017 16:50:52 +0000 (16:50 +0000)]
Print flags in hex instead of decimal.

Hex is easier to grok for flags, and consistent with other prints.

7 years agoUpdate ntp.conf to use the ntpd pool feature.
Ian Lepore [Mon, 2 Jan 2017 15:19:22 +0000 (15:19 +0000)]
Update ntp.conf to use the ntpd pool feature.

Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org
using 3 separate 'server' config lines.  That is now replaced with a single
'pool' line which causes ntpd to add multiple servers from the pool.

More than just making the config smaller, the pool feature in ntpd has one
major advantage over configuring 3 separate servers from a pool: if a server
that was added using a 'pool' statement provides bad time (initially or at
some later date), ntpd automatically discards it and configures a new
different server from the pool without needing to be restarted.

These changes also add a 'tos' line to control how many pool servers get
added, a 'restrict source' line that is required to allow ntpd to add new
peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does
nothing and should never have been there (127.127.1.0 is not a valid IP
address, it's a refclock identifier).

Differential Revision: https://reviews.freebsd.org/D9011

7 years agoCleanup inelegant calloc(3) introduced in r310984.
Pedro F. Giffuni [Mon, 2 Jan 2017 15:17:33 +0000 (15:17 +0000)]
Cleanup inelegant calloc(3) introduced in r310984.

7 years agolibkvm - extend a bit the swap statistics field.
Pedro F. Giffuni [Mon, 2 Jan 2017 15:12:11 +0000 (15:12 +0000)]
libkvm - extend a bit the swap statistics field.

Change ksw_used and ksw_total to unsigned, which increases the maximum
total swap that can be displayed properly from ~8TB to ~16TB.

Obtained from: DragonflyBSD (ecc2e461)
MFC after: 2 weeks

7 years agoRemove unneeded externs keywords. Reindent long lines.
Konstantin Belousov [Mon, 2 Jan 2017 09:02:39 +0000 (09:02 +0000)]
Remove unneeded externs keywords.  Reindent long lines.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years ago[netmap] call RLOCK /and/ RUNLOCK.
Adrian Chadd [Mon, 2 Jan 2017 06:36:12 +0000 (06:36 +0000)]
[netmap] call RLOCK /and/ RUNLOCK.

Reported by: olivier

7 years agoFactor out instances of a knote detach followed by a knote_drop() call.
Mark Johnston [Mon, 2 Jan 2017 01:23:21 +0000 (01:23 +0000)]
Factor out instances of a knote detach followed by a knote_drop() call.

Reviewed by: kib (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9015

7 years ago2017 IFLIB updates in preparation for commits to e1000 and ixgbe.
Sean Bruno [Mon, 2 Jan 2017 00:56:33 +0000 (00:56 +0000)]
2017 IFLIB updates in preparation for commits to e1000 and ixgbe.
- iflib - add checksum in place support (mmacy)
- iflib - initialize IP for TSO (going to be needed for e1000) (mmacy)
- iflib - move isc_txrx from shared context to softc context (mmacy)
- iflib - Normalize checks in TXQ drainage. (shurd)
- iflib - Fix queue capping checks (mmacy)
- iflib - Fix invalid assert, em can need 2 sentinels (mmacy)
- iflib - let the driver determine what capabilities are set and what
          tx csum flags are used (mmacy)
- add INVARIANTS debugging hooks to gtaskqueue enqueue (mmacy)
- update bnxt(4) to support the changes to iflib (shurd)

Some other various, sundry updates.  Slightly more verbose changelog:

Submitted by: mmacy@nextbsd.org
Reviewed by: shurd
mFC after:
Sponsored by: LimeLight Networks and Dell EMC Isilon

7 years agoStyle fixes for vm_map_insert().
Konstantin Belousov [Sun, 1 Jan 2017 18:49:46 +0000 (18:49 +0000)]
Style fixes for vm_map_insert().

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove some uses of the GCC __nonnull() attribute.
Pedro F. Giffuni [Sun, 1 Jan 2017 17:16:47 +0000 (17:16 +0000)]
Remove some uses of the GCC __nonnull() attribute.

While the checks are considered useful, the attribute does dangerous
optimizations, removing NULL checks where they can be needed. Remove the
uses of this attribute introduced in r281130: the changes were inspired on
Google's bionic where this attribute is not used anymore.

The __nonnull() attribute will be deprecrated from our headers and
replaced with the Clang _Nonnull qualifier in the future.

MFC after: 3 days

7 years agoFix up grammar.
Cy Schubert [Sun, 1 Jan 2017 10:37:10 +0000 (10:37 +0000)]
Fix up grammar.

MFC after: 3 days

7 years agofd: access openfiles once in falloc_noinstall
Mateusz Guzik [Sun, 1 Jan 2017 08:55:28 +0000 (08:55 +0000)]
fd: access openfiles once in falloc_noinstall

This is similar to what's done with nprocs.

Note this is only a band aid.

7 years agoFix spelling errors; bump .Dd for the change
Enji Cooper [Sun, 1 Jan 2017 05:23:01 +0000 (05:23 +0000)]
Fix spelling errors; bump .Dd for the change

MFC after: 3 days

7 years agoInstall bsnmpclient(3) as snmp_client_{init,set_host,set_port}(3)
Enji Cooper [Sun, 1 Jan 2017 05:21:08 +0000 (05:21 +0000)]
Install bsnmpclient(3) as snmp_client_{init,set_host,set_port}(3)

MFC after: 3 days
X-MFC with: r310999

7 years agoBump .Dd for the spelling and .Nm updates
Enji Cooper [Sun, 1 Jan 2017 05:16:24 +0000 (05:16 +0000)]
Bump .Dd for the spelling and .Nm updates

MFC after: 3 days

7 years agoFix spelling errors
Enji Cooper [Sun, 1 Jan 2017 05:14:58 +0000 (05:14 +0000)]
Fix spelling errors

MFC after: 3 days
Reported by: igor

7 years agobsnmpclient(3) also documents snmp_client_init, snmp_client_set_host,
Enji Cooper [Sun, 1 Jan 2017 05:13:54 +0000 (05:13 +0000)]
bsnmpclient(3) also documents snmp_client_init, snmp_client_set_host,
and snmp_client_set_port. Add them to the NAME section

MFC after: 3 days

7 years agoLook for list.h in ${.CURDIR} to unbreak the build with a ports-based copy
Enji Cooper [Sun, 1 Jan 2017 04:13:24 +0000 (04:13 +0000)]
Look for list.h in ${.CURDIR} to unbreak the build with a ports-based copy
of llvm38 on ^/stable/11 (oh, the bugs you find when you set CC,CXX,CPP
manually and it skips the bootstrap stage for the toolchain...)

7 years agoBump WARNS to 6 to catch simple QA issues like some of the ones I squashed
Enji Cooper [Sun, 1 Jan 2017 04:02:06 +0000 (04:02 +0000)]
Bump WARNS to 6 to catch simple QA issues like some of the ones I squashed
in r310994

7 years agoMake sys/vfs/lookup_cap_dotdot actually work with "kyua test"
Enji Cooper [Sun, 1 Jan 2017 04:01:27 +0000 (04:01 +0000)]
Make sys/vfs/lookup_cap_dotdot actually work with "kyua test"

The tests don't work when reading/writing to file descriptors in the
sandbox after entering capability mode (and wouldn't have, regardless
of the framework), so adjust the tests so they function within the
framework.

For tests that enter capability mode over the course of the test, the
following is now done:

  1. Fork child process for capability mode test.
  2. In child...
     i.   Enter capability mode.
     ii.  Test invariants.
     iii. Exit after calling test function.
  3. Collect status for child and determine whether or not it completed
     successfully.

In order to test the invariants in the child process, they now use assert(3)
instead of ATF_REQUIRE*, as the atf-c-api functions right to results files
in the directories in order to determine where and how tests fail.

While in the area, fix several -Wshadow and -Wunused warnings found when I
bumped WARNS up to 6, and fix some minor style(9) issues with indentation
and type alignment.

PR: 215690

7 years agoCall snmp_pdu_free on req/resp with a consistent, correct pattern
Enji Cooper [Sun, 1 Jan 2017 00:23:43 +0000 (00:23 +0000)]
Call snmp_pdu_free on req/resp with a consistent, correct pattern

- snmp_pdu_free should be called before snmp_pdu_create is called
  again
- snmp_pdu_free should be called on the resp to snmp_dialog when
  successful

Tested with the following bsnmp commands:

  % export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest
  % SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0"
  % bsnmpset $SNMP_ARGS sysLocation="MyAgent"
  % bsnmpget $SNMP_ARGS sysLocation
  % bsnmpwalk $SNMP_ARGS

MFC after: 12 days
X-MFC with: r310729, r310892, r310894

7 years agosnmp_discover_engine: fix up req/resp (PDU object) handling a bit
Enji Cooper [Sat, 31 Dec 2016 23:20:57 +0000 (23:20 +0000)]
snmp_discover_engine: fix up req/resp (PDU object) handling a bit

- Call snmp_pdu_free on req and resp when done with the objects
- Call snmp_pdu_free on req before calling snmp_pdu_create on it
  again

MFC after: 1 week

7 years agosnmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not
Enji Cooper [Sat, 31 Dec 2016 22:46:17 +0000 (22:46 +0000)]
snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not
on the stack

Some of the callers try to determine whether or not `object` is valid by
testing the value for NULL, which will never be true if it's a stack value,
so in order to be clear and correct down the call stack, use a heap
allocated object.

This also addresses a Coverity issue by initializing all of `object` via
calloc

MFC after: 1 week
Reported by: Coverity
CID: 1006392

7 years agosnmp_output_resp: style(9): sort variables by alignment
Enji Cooper [Sat, 31 Dec 2016 22:18:33 +0000 (22:18 +0000)]
snmp_output_resp: style(9): sort variables by alignment

MFC after: 3 days

7 years agoUpdate ObsoleteFiles.inc for r310803
Alan Somers [Sat, 31 Dec 2016 21:31:58 +0000 (21:31 +0000)]
Update ObsoleteFiles.inc for r310803

MFC after: 26 days
X-MFC-with: 310803

7 years agoUse calloc instead of malloc + memset(.., 0, ..)
Enji Cooper [Sat, 31 Dec 2016 21:00:08 +0000 (21:00 +0000)]
Use calloc instead of malloc + memset(.., 0, ..)

MFC after: 1 week

7 years agovfs: switch nodes_created, recycles_count and free_owe_inact to counter(9)
Mateusz Guzik [Sat, 31 Dec 2016 19:59:31 +0000 (19:59 +0000)]
vfs: switch nodes_created, recycles_count and free_owe_inact to counter(9)

Reviewed by: kib

7 years agoAnsify vm/vm_pager.c. Style.
Konstantin Belousov [Sat, 31 Dec 2016 19:30:22 +0000 (19:30 +0000)]
Ansify vm/vm_pager.c.  Style.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAddition of clang nullability qualifiers.
Pedro F. Giffuni [Sat, 31 Dec 2016 15:58:15 +0000 (15:58 +0000)]
Addition of clang nullability qualifiers.

Add two new qualifiers for use by the static checkers:

_Nonnull
The _Nonnull nullability qualifier indicates that null is not a meaningful
value for a value of the _Nonnull pointer type.

_Nullable
The _Nullable nullability qualifier indicates that a value of the
_Nullable pointer type can be null.

These were introduced in Clang 3.7. For more information, see:
http://clang.llvm.org/docs/AttributeReference.html#nonnull

We add these now without using them so that the GCC ports have time to
pick up the header change.

Hinted by: Android Bionic libc [1]
Also seen in: Apple's Libc-1158.20.4

[1]
https://github.com/android/platform_bionic/commit/baa2a973bd776a51bb05a8590ab05d86eea7b321

7 years agoMove __hidden attribute towards the end of the declaration.
Pedro F. Giffuni [Sat, 31 Dec 2016 15:30:00 +0000 (15:30 +0000)]
Move __hidden attribute towards the end of the declaration.

Apple had them at the start but moving them to the end is better for
faster reading and fits better what is done in other FreeBSD headers.

MFC after: 5 days

7 years ago- Use more descriptive names for variables.
Hiroki Sato [Sat, 31 Dec 2016 13:15:52 +0000 (13:15 +0000)]
- Use more descriptive names for variables.
- Set O_CLOEXEC to the signal pipe and /dev/klog.
- Use a single signal handler to catch both SIGHUP and SIGCHLD.
- Fix a bug which did FD_SET() the writer-end of the pipe.

7 years agoFix a typo in the third address of the reg property for the usbphy node.
Jared McNeill [Sat, 31 Dec 2016 13:10:06 +0000 (13:10 +0000)]
Fix a typo in the third address of the reg property for the usbphy node.

MFC after: 1 week

7 years agoBump copyright year.
Baptiste Daroussin [Sat, 31 Dec 2016 12:41:42 +0000 (12:41 +0000)]
Bump copyright year.

Happy New Year 2017!

7 years agosysctl(8): fix typename for uint32_t.
Andriy Voskoboinyk [Sat, 31 Dec 2016 12:39:15 +0000 (12:39 +0000)]
sysctl(8): fix typename for uint32_t.

MFC after: 5 days.

7 years agoSimilar to r310954, set .len to 0 on malloc failure and to `len` only
Enji Cooper [Sat, 31 Dec 2016 12:37:53 +0000 (12:37 +0000)]
Similar to r310954, set .len to 0 on malloc failure and to `len` only
on success

MFC after: 1 week

7 years agoInitialize ret to SNMPD_INPUT_OK at the top of snmp_input_start(..) to
Enji Cooper [Sat, 31 Dec 2016 12:30:14 +0000 (12:30 +0000)]
Initialize ret to SNMPD_INPUT_OK at the top of snmp_input_start(..) to
avoid returning an uninitialized value

There are some really complicated, snakey if-statements combined with
switch statements that could result in an invalid value being returned
as `ret`

MFC after: 1 week
Reported by: Coverity
CID: 1006551

7 years agoUse strlcpy when copying `com` to pdu->community to avoid potential
Enji Cooper [Sat, 31 Dec 2016 12:18:17 +0000 (12:18 +0000)]
Use strlcpy when copying `com` to pdu->community to avoid potential
buffer overruns

MFC after: 1 week
Reported by: Coverity
CID: 10068231006824

7 years agoSet value->v.octetstring.len to a correct value on malloc success/failure
Enji Cooper [Sat, 31 Dec 2016 12:14:25 +0000 (12:14 +0000)]
Set value->v.octetstring.len to a correct value on malloc success/failure

The previous code always set value->v.octetstring.len to len, regardless
of the result from the malloc call. This misleads the caller on malloc
failure. Set .len to len on success and 0 on failure.

MFC after: 1 week
Reported by: Coverity
CID: 1007590

7 years agoMIB-II: use strlcpy instead of strcpy when copying {descr,name}
Enji Cooper [Sat, 31 Dec 2016 12:03:25 +0000 (12:03 +0000)]
MIB-II: use strlcpy instead of strcpy when copying {descr,name}

This is of course to avoid buffer overruns

The remaining strcpy instance in the module needs to be audited for
correctness

MFC after: 1 week
Reported by: Coverity
CID: 10068271006828

7 years agoMIB-II: use strlcpy when copying interface names to .ifr_name
Enji Cooper [Sat, 31 Dec 2016 11:50:36 +0000 (11:50 +0000)]
MIB-II: use strlcpy when copying interface names to .ifr_name

.ifra_name is assumed to be NUL terminated; using strlcpy(3)
ensures that it's indeed NUL terminated whereas strncpy does
not.

Tested and verified as follows with a combination of ifconfig,
snmpget, and snmpset:

  % ifconfig create lo1 127.0.0.2/8
  % SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X bsnmptest localhost"
  % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
  % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2
  IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
  % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
  IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
  % snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1
  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
  % snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
  IF-MIB::ifAdminStatus.4 = INTEGER: up(1)

MFC after: 2 weeks
Reported by: Coverity
CID: 1009652-10096561349850

7 years agoUnbreak the build by passing the string to strdup, not its length
Enji Cooper [Sat, 31 Dec 2016 11:24:12 +0000 (11:24 +0000)]
Unbreak the build by passing the string to strdup, not its length

MFC after: 1 week
X-MFC with: r310931
Pointyhat to: ngie

7 years agoUse strdup in snmp_parse_server(..) when possible instead of malloc+strcpy
Enji Cooper [Sat, 31 Dec 2016 11:13:00 +0000 (11:13 +0000)]
Use strdup in snmp_parse_server(..) when possible instead of malloc+strcpy

This simplifies the code and mutes a Coverity warning about sc->cport being
improperly allocated

Reported by: Coverity
CID: 1018247
MFC after: 1 week

7 years agoRemove unused declaration.
Konstantin Belousov [Sat, 31 Dec 2016 11:07:33 +0000 (11:07 +0000)]
Remove unused declaration.

The setconf() implementation was removed by r52778 Nov 1 1999.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years ago- Add static for symbols which need not to be exported.
Hiroki Sato [Sat, 31 Dec 2016 11:03:34 +0000 (11:03 +0000)]
- Add static for symbols which need not to be exported.
- Clean up warnings to the WARNS=6 level.

7 years agoUse vrefact in vnode_pager_alloc.
Mateusz Guzik [Sat, 31 Dec 2016 10:37:56 +0000 (10:37 +0000)]
Use vrefact in vnode_pager_alloc.

7 years agosnmp_pdu_free the right object at the right time in snmptool_walk
Enji Cooper [Sat, 31 Dec 2016 10:01:25 +0000 (10:01 +0000)]
snmp_pdu_free the right object at the right time in snmptool_walk

r310892 was on the right track, but unfortunately it was resolving
the problem incorrectly and accidentally leaking memory in the
process.

- Call snmp_pdu_free on req before calling snmp_pdu_create on it
  at the bottom of the outer while loop
- Call snmp_pdu_free on resp after calling snmpwalk_nextpdu_create
  in the inner loop

MFC after: 12 days
X-MFC with: r310729, r310892
Reported by: valgrind

7 years agoRemove extra NULL-check before free(3).
Hiroki Sato [Sat, 31 Dec 2016 09:52:00 +0000 (09:52 +0000)]
Remove extra NULL-check before free(3).

7 years agoDon't call snmp_pdu_free(..) until finished with the pdu and when ready to
Enji Cooper [Sat, 31 Dec 2016 09:43:35 +0000 (09:43 +0000)]
Don't call snmp_pdu_free(..) until finished with the pdu and when ready to
allocate a new one via snmp_pdu_create(..)

This fixes bsnmpwalk, so it no longer crashes after r310729

X-MFC with: r310729
MFC after: 12 days

7 years ago[net80211] add placeholders for the VHT action frame handling.
Adrian Chadd [Sat, 31 Dec 2016 07:50:14 +0000 (07:50 +0000)]
[net80211] add placeholders for the VHT action frame handling.

Upcoming vht support will register send/receive action handlers.

7 years agoReplace two fat signal handlers with function calls in
Hiroki Sato [Sat, 31 Dec 2016 06:23:05 +0000 (06:23 +0000)]
Replace two fat signal handlers with function calls in
the main I/O multiplex loop.  select() now watches
a pipe which is written by the new skinny signal
handlers and the received signals are handled inside
the loop sequencially.

This eliminates a complex signal mask to guarantee
async-signal safety.

7 years agoDo not remove llvm-objdump. It is installed by default since r310840.
Jung-uk Kim [Sat, 31 Dec 2016 06:07:48 +0000 (06:07 +0000)]
Do not remove llvm-objdump.  It is installed by default since r310840.

7 years agoRetry to open an F_PIPE process when it dies unexpectedly.
Hiroki Sato [Sat, 31 Dec 2016 03:07:48 +0000 (03:07 +0000)]
Retry to open an F_PIPE process when it dies unexpectedly.

Reported by: Eugene Grosbein
PR: 215335

7 years agoFix rcc_gpio_modify_bits(). Obviously (1 << 0) is not the same as 0.
Luiz Otavio O Souza [Sat, 31 Dec 2016 02:23:15 +0000 (02:23 +0000)]
Fix rcc_gpio_modify_bits().  Obviously (1 << 0) is not the same as 0.

Pointy hat to: loos
MFC after: 3 days

7 years agoFixes the sensor initialization, always reset the digital outputs to start.
Luiz Otavio O Souza [Sat, 31 Dec 2016 02:18:08 +0000 (02:18 +0000)]
Fixes the sensor initialization, always reset the digital outputs to start.

Obtained from: pfSense
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRemove extra entries from the option enum
Baptiste Daroussin [Fri, 30 Dec 2016 23:46:11 +0000 (23:46 +0000)]
Remove extra entries from the option enum

MFC after: 3 days

7 years agoGuard against use-after-free after calling mibif_free(..)
Enji Cooper [Fri, 30 Dec 2016 23:44:39 +0000 (23:44 +0000)]
Guard against use-after-free after calling mibif_free(..)

Set variables to NULL after calling free.

Also, remove unnecessary if (x != NULL) checks before calling free(x)

MFC after: 1 week

7 years agoMake sdiff --left-column work as expected
Baptiste Daroussin [Fri, 30 Dec 2016 23:41:33 +0000 (23:41 +0000)]
Make sdiff --left-column work as expected

MFC after: 3 days

7 years agoMFV r310869:
Martin Matuska [Fri, 30 Dec 2016 23:05:06 +0000 (23:05 +0000)]
MFV r310869:

Sync libarchive with vendor.

Vendor bugfixes:
Use __LA_DEPRECATED macro with functions deprecated in 379867e (r310796)

MFC after: 2 weeks
X-MFC with: r310866

7 years agoUpdate vendor/libarchive to git ab94a813b0f64cbc1bcb952bf55424a2d9c7f1d9
Martin Matuska [Fri, 30 Dec 2016 23:00:00 +0000 (23:00 +0000)]
Update vendor/libarchive to git ab94a813b0f64cbc1bcb952bf55424a2d9c7f1d9

Vendor bugfixes:
Use __LA_DEPRECATED macro with functions deprecated in 379867e (r310796)

7 years agoMFV r310798:
Martin Matuska [Fri, 30 Dec 2016 22:54:08 +0000 (22:54 +0000)]
MFV r310798:

Sync libarchive with vendor.

Vendor bugfixes (relevant to FreeBSD):
PR #843: Fix memory leak of struct archive_entry in cpio/cpio.c
PR #851: Spelling fixes
Fix two protoypes in manual page archive_read_disk.3

MFC after: 2 weeks

7 years agortwn: add (untested) radar detection support for RTL8821AU
Andriy Voskoboinyk [Fri, 30 Dec 2016 22:24:01 +0000 (22:24 +0000)]
rtwn: add (untested) radar detection support for RTL8821AU
(disabled by default).

To enable it, dev.rtwn.%d.radar_detection tunable need to be set
to a nonzero value.

Tested with RTL8821AU, AP mode (no radar events were seen - so,
I have no idea if it is really correct / working)

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D8903

7 years agoMFV r310796, r310797:
Martin Matuska [Fri, 30 Dec 2016 22:18:22 +0000 (22:18 +0000)]
MFV r310796, r310797:

Sync libarchive with vendor.

Vendor changes (relevant to FreeBSD):
PR #771: Add NFSv4 ACL support to pax and restricted pax

NFSv4 ACL information may now be stored to and restored from tar archives.
ACL must be non-trivial and supported by the underlying filesystem, e.g.
natively by ZFS or by UFS with the NFSv4 ACL enable flag set.

MFC after: 2 weeks
Relnotes: yes

7 years agoFix whitespace in a comment and fixing a spelling error in a comment
Enji Cooper [Fri, 30 Dec 2016 21:41:01 +0000 (21:41 +0000)]
Fix whitespace in a comment and fixing a spelling error in a comment

MFC after: 3 days

7 years agoUnbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6
Enji Cooper [Fri, 30 Dec 2016 21:33:01 +0000 (21:33 +0000)]
Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6
structs under the INET6 #ifdef. Similarly (even though it doesn't seem
to affect the build), conditionalize all IPv4 structs under the INET
#ifdef

This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not
verified other MACHINE/TARGET pairs (e.g. armv6/arm).

MFC after: 2 weeks
X-MFC with: r310847
Pointyhat to: jpaetzel
Reported by: O. Hartmann <o.hartmann@walstatt.org>

7 years agoindent(1): Avoid out of bounds access of array ps.paren_indents
Piotr Pawel Stefaniak [Fri, 30 Dec 2016 21:00:45 +0000 (21:00 +0000)]
indent(1): Avoid out of bounds access of array ps.paren_indents

ps.p_l_follow can't be allowed to grow beyond maximum index of paren_indents.

Approved by: pfg (mentor)

7 years agoAdd missing reg property to usbphy node.
Jared McNeill [Fri, 30 Dec 2016 20:16:09 +0000 (20:16 +0000)]
Add missing reg property to usbphy node.

MFC after: 1 week

7 years agoloader: nandfs calls strategy with one extra argument.
Toomas Soome [Fri, 30 Dec 2016 20:00:41 +0000 (20:00 +0000)]
loader: nandfs calls strategy with one extra argument.

The strategy argument cleanup in r310850 did miss another call to strategy(),
and left it with extra argument.

Reviewed by: allanjude
Approved by: allanjude (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D9003

7 years agodosfs support in libstand is broken since r298230
Toomas Soome [Fri, 30 Dec 2016 19:06:29 +0000 (19:06 +0000)]
dosfs support in libstand is broken since r298230

Apparently the libstand dosfs optimization is a bit too optimistic
and did introduce possible memory corruption.

This patch is backing out the bad part and since this results in
dosfs reading full blocks now, we can also remove extra offset argument
from dv_strategy callback.

The analysis of the issue and the backout patch is provided by Mikhail Kupchik.

PR: 214423
Submitted by: Mikhail Kupchik
Reported by: Mikhail Kupchik
Reviewed by: bapt, allanjude
Approved by: allanjude (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8644

7 years agoFix two similar bugs in the populate vm_fault() code.
Konstantin Belousov [Fri, 30 Dec 2016 18:55:33 +0000 (18:55 +0000)]
Fix two similar bugs in the populate vm_fault() code.

If pager' populate method succeeded, but other thread raced with us
and modified vm_map, we must unbusy all pages busied by the pager,
before we retry the whole fault handling.  If pager instantiated more
pages than fit into the current map entry, we must unbusy the pages
which are clipped.

Also do some refactoring, clarify comments and use more clear local
variable names.

Reported and tested by: kargl, subbsd@gmail.com (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoHarden CARP against network loops.
Josh Paetzel [Fri, 30 Dec 2016 18:46:21 +0000 (18:46 +0000)]
Harden CARP against network loops.

If there is a loop in the network a CARP that is in MASTER state will see it's
own broadcasts, which will then cause it to assume BACKUP state.  When it
assumes BACKUP it will stop sending advertisements.  In that state it will no
longer see advertisements and will assume MASTER...

We can't catch all the cases where we are seeing our own CARP broadcast, but
we can catch the obvious case.

Submitted by: torek
Obtained from: FreeNAS
MFC after: 2 weeks
Sponsored by: iXsystems

7 years agoMerge CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mostly
Olivier Houchard [Fri, 30 Dec 2016 18:23:58 +0000 (18:23 +0000)]
Merge CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mostly
to make sure we don't use any FP instruction.

7 years agoboot2 will deadlock if extended keys are used on text input
Toomas Soome [Fri, 30 Dec 2016 18:21:52 +0000 (18:21 +0000)]
boot2 will deadlock if extended keys are used on text input

The boot2 family of bootblocks (zfsboot/gptzfsboot) are using separate
implementation if keyboard reading code, which has deadlock case when
extended key (arrows etc) are pressed.

The problem is about avoiding the noise from some systems, generating
false key events with scan code 1 and ascii code 00, so the code
does attempt to filter such cases out. Unfortunately the extended keys
also set ascii 0, and therefore the pressed key event is ignored and
the keypress is never read, resulting in infinite loop.

This update is moving the check to keyhit() function and is allowing
the rest of the code to process the extended keys.

Reviewed by: bapt, allanjude
Approved by: allanjude (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8608

7 years agoImport CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mainly
Olivier Houchard [Fri, 30 Dec 2016 18:14:30 +0000 (18:14 +0000)]
Import CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mainly
to add the option to disable double-related functions, as we don't want
them in the kernel.

7 years agoReapply 310775, now it also builds correctly if lldb is disabled:
Dimitry Andric [Fri, 30 Dec 2016 18:00:31 +0000 (18:00 +0000)]
Reapply 310775, now it also builds correctly if lldb is disabled:

Move llvm-objdump from CLANG_EXTRAS to installed by default

We currently install three tools from binutils 2.17.50: as, ld, and
objdump. Work is underway to migrate to a permissively-licensed
tool-chain, with one goal being the retirement of binutils 2.17.50.

LLVM's llvm-objdump is intended to be compatible with GNU objdump
although it is currently missing some options and may have formatting
differences. Enable it by default for testing and further investigation.
It may later be changed to install as /usr/bin/objdump, it becomes a
fully viable replacement.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D8879

7 years agoAssert that the pages found on the object queue by vm_page_next() and
Konstantin Belousov [Fri, 30 Dec 2016 17:37:06 +0000 (17:37 +0000)]
Assert that the pages found on the object queue by vm_page_next() and
vm_page_prev() have correct ownership.

In collaboration with: alc
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week

7 years agoRestore status quo: mips64 does not need subr_sfbuf.c
Alexander Kabaev [Fri, 30 Dec 2016 17:12:41 +0000 (17:12 +0000)]
Restore status quo: mips64 does not need subr_sfbuf.c

Reported by: br

7 years agoAdd parenthesis.
Ruslan Bukin [Fri, 30 Dec 2016 16:26:54 +0000 (16:26 +0000)]
Add parenthesis.

Noticed by: hps
Sponsored by: DARPA, AFRL

7 years agoo Fix unlocking.
Ruslan Bukin [Fri, 30 Dec 2016 16:06:05 +0000 (16:06 +0000)]
o Fix unlocking.
o Fix types for ds_addr/ds_len.

Sponsored by: DARPA, AFRL

7 years agoFix inverted loop condition which broke multi-line responses to CONNECT.
Dag-Erling Smørgrav [Fri, 30 Dec 2016 14:54:54 +0000 (14:54 +0000)]
Fix inverted loop condition which broke multi-line responses to CONNECT.

PR: 194483
Submitted by: Miłosz Kaniewski <milosz.kaniewski@gmail.com>
MFC after: 1 week

7 years ago[netmap] fix locking regressions
Adrian Chadd [Fri, 30 Dec 2016 14:47:46 +0000 (14:47 +0000)]
[netmap] fix locking regressions

* Firmware oriented NICs may need to sleep in their configuration paths.
  Use RLOCK instead of WLOCK to allow this to again occur.

  This fixes netmap on cxgbe.

* Change the worker lock to a normal mutex rather than a spin lock.
  Drivers shouldn't be doing netmap work from the fast interrupt
  handlers, so it's not required to be a spinlock.

Submitted by: luigi, Vincenzo Maffione <v.maffione@gmail.com>
Reviewed by: jhb

7 years agoStyle.
Konstantin Belousov [Fri, 30 Dec 2016 13:04:43 +0000 (13:04 +0000)]
Style.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agosfxge(4): move queue size checks to after the NIC config has been populated
Andrew Rybchenko [Fri, 30 Dec 2016 12:23:02 +0000 (12:23 +0000)]
sfxge(4): move queue size checks to after the NIC config has been populated

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8974

7 years agosfxge(4): cleanup: add efsys_lock_state_t for type of state param in EFSYS_LOCK()
Andrew Rybchenko [Fri, 30 Dec 2016 12:19:40 +0000 (12:19 +0000)]
sfxge(4): cleanup: add efsys_lock_state_t for type of state param in EFSYS_LOCK()

This allows the common code to use the correct type for the lock state
local variable passed to EFSYS_LOCK() and EFSYS_UNLOCK().

On Windows, this allows warning supression pragmas to be removed.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

7 years agosfxge(4): support per-command MCDI timeout
Andrew Rybchenko [Fri, 30 Dec 2016 12:10:15 +0000 (12:10 +0000)]
sfxge(4): support per-command MCDI timeout

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

7 years agosfxge(4): remove obsolete Wake-On-LAN support
Andrew Rybchenko [Fri, 30 Dec 2016 12:06:55 +0000 (12:06 +0000)]
sfxge(4): remove obsolete Wake-On-LAN support

Wake-on-lan is not supported in production on any of our adapters, as
they don't have the required AUX power connector. (It's possible that
AUX power is supplied to some of our ALOM or mezz adapters, but if so
then we've never implemented or tested WoL support.)

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D8972

7 years agosfxge(4): fix efx_filter_supported_filters API
Andrew Rybchenko [Fri, 30 Dec 2016 12:02:16 +0000 (12:02 +0000)]
sfxge(4): fix efx_filter_supported_filters API

The previous API had various problems, including the length of the
caller provided buffer not being specified, no means being available
to discover how big the buffer needs to be, and a lack of clarity of
what the resulting list contains.

To fix it:
- add the buffer length as a parameter
- if the provided buffer is too short, fail with ENOSPC and return the
  required length
- ensure that the list contents are valid and add comments
  describing it

It is safe to change this API as, unsuprisingly, it has no users.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D8971