]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r311748:
ngie [Sat, 14 Jan 2017 00:39:55 +0000 (00:39 +0000)]
MFC r311748:

Bump WARNS up from 0 to 6

git-svn-id: svn://svn.freebsd.org/base/stable/10@312100 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311750,r311754,r311757:
ngie [Sat, 14 Jan 2017 00:36:48 +0000 (00:36 +0000)]
MFC r311750,r311754,r311757:

r311750:

Check result from smiGetFirstNode and smiGetNodeByOID

This avoids a segfault with malformed or unanticipated files,
like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS).

Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt

r311754:

Use calloc instead of malloc + memset(.., 0, ..)

r311757:

Similar to r311750, check for the result from smiGetModule to avoid a segfault
when dereferencing a NULL pointer later on.

Choose to just check for the NULL pointer in the next for-loop for now to fix
the issue with a minimal amount of code churn

sys/queue.h use here would make more sense than using a static table

git-svn-id: svn://svn.freebsd.org/base/stable/10@312098 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311236,r311919:
ngie [Sat, 14 Jan 2017 00:33:03 +0000 (00:33 +0000)]
MFC r311236,r311919:

r311236:

unlink_fifo: don't leak the file descriptors opened with mkfifo and open

MFC fater: 3 days
CID: 978316, 978317

r311919:

Partially revert r311236

There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.

The mkfifo case does make sense to keep though.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312096 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311924:
ngie [Sat, 14 Jan 2017 00:29:55 +0000 (00:29 +0000)]
MFC r311924:

Fix whitespace in comment

git-svn-id: svn://svn.freebsd.org/base/stable/10@312095 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311926:
ngie [Sat, 14 Jan 2017 00:28:21 +0000 (00:28 +0000)]
MFC r311926:

Consolidate __NetBSD__ #ifdef

git-svn-id: svn://svn.freebsd.org/base/stable/10@312092 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311227,r311917:
ngie [Sat, 14 Jan 2017 00:26:52 +0000 (00:26 +0000)]
MFC r311227,r311917:

r311227:

seekdir_basic: fix various Coverity issues

Address..
- .. resource leaks of file descriptors and memory
- .. unchecked return values from creat(2), mkdir(2), and telldir(3)
- .. potential NULL derefs after calling readdir(3)

CID: 975255, 975256, 976989, 978989, 978990

r311917:

Fix up r311227

Check for creat returning a value != -1, not a non-zero value

Pointyhat to: ngie
CID: 1368366

git-svn-id: svn://svn.freebsd.org/base/stable/10@312091 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310950:
ngie [Sat, 14 Jan 2017 00:24:46 +0000 (00:24 +0000)]
MFC r310950:

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)

CID: 1009652-10096561349850

git-svn-id: svn://svn.freebsd.org/base/stable/10@312089 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 304492,310721,310734: Update cxgbe info in NOTES.
jhb [Fri, 13 Jan 2017 21:42:36 +0000 (21:42 +0000)]
MFC 304492,310721,310734: Update cxgbe info in NOTES.

304492:
Move cxgb and cxgbe down to the non-mii PCI NIC section.

310721:
Mention T6 and 100GbE in description of cxgbe.

310734:
Note that the Chelsio T6 also supports 25Gbps.

To avoid overflowing 80 columns, condense the cxgbe description a bit.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311525:
kib [Fri, 13 Jan 2017 12:47:44 +0000 (12:47 +0000)]
MFC r311525:
Lock tmpfs node tn_status updates done under the shared vnode lock.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312069 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311524:
kib [Fri, 13 Jan 2017 12:45:54 +0000 (12:45 +0000)]
MFC r311524:
Use vnode lock assertion expression, assert exclusive ownership.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312068 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311523:
kib [Fri, 13 Jan 2017 12:44:52 +0000 (12:44 +0000)]
MFC r311523:
Remove dead code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312067 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310718:
amdmi3 [Fri, 13 Jan 2017 10:28:24 +0000 (10:28 +0000)]
MFC r310718:

bzip2 does not exit after showing license as requested with --version
or --license as most apps would do, instead it waits for data to
compress on stdin. Because of that, if `bzip2 --version' is called,
bogus `bzip2: I won't write compressed data to a terminal' error
message will be displayed, and checking for bzip2 version in scripts
as in

    bzip2 --version 2>&1 | grep -o "Version [^,]*"

will hand as bzip2 would wait for data to compress on stdin. Fix
this by exiting right after showing version/license text.

I've tried to push this upstream for more than a year, but author
is unresponsive, so upstream may be considered dead.

Ubuntu applies similar fix, for the note.

PR: 199443
Approved by: dim, bapt
Differential Revision: D8924

git-svn-id: svn://svn.freebsd.org/base/stable/10@312061 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310586,r310587,r310588,r311381:
ngie [Fri, 13 Jan 2017 09:19:04 +0000 (09:19 +0000)]
MFC r310586,r310587,r310588,r311381:

r310586:

Refactor transport sources a bit to facilitate changes coming down pipeline

Add recv callback to transport layer to better facilitate code reuse and
readability and for symmetry with send callback. Move recv_dgram and
recv_stream to udp_recv and lsock_recv, respectively, and make the
beforementioned functions recv callbacks for the udp and lsock transports,
respectively.

Consolidate the check_priv* functions in their relevant trans*.c source to
limit scope/use.

Note: this code is roughly based content from the submitter, although this
was modified to be more of a direct move from snmpd/main.c to the trans_*.c
sources, and to reduce unnecessary static function declarations.

r310587:

Fix definition for recv_dgram(..); it should be "ssize_t", not "int"

I'm not sure why this wasn't flagged as an issue by the compiler, yet

r310588:

Fix return type for `ret` (recv callback) and sort variables by alignment

Again, for reasons I don't yet understand, this is not being flagged by the
compiler. Unlike the issue addressed in r310587, this problem existed prior
to r310586

r311381:

lsock_init_port: address issues with initializing sockaddr_un object

- Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*].
- Use SUN_LEN(..) instead of spelling out calculation longhand (inspired
  by comment by jmallett).

Tested with: dgram and stream support with both bsnmpwalk and snmpwalk

CID: 1006825

git-svn-id: svn://svn.freebsd.org/base/stable/10@312058 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311739:
ngie [Fri, 13 Jan 2017 09:07:25 +0000 (09:07 +0000)]
MFC r311739:

Use SRCTOP instead of spelling out the full path with .CURDIR

This helps condense the output for CFLAGS and .PATH

git-svn-id: svn://svn.freebsd.org/base/stable/10@312055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311378:
ngie [Fri, 13 Jan 2017 09:04:29 +0000 (09:04 +0000)]
MFC r311378:

lm_load: fix string copying issues

- Ensure `section` doesn't overrun section by using strlcpy instead of
  strcpy [*].
- Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity,
  but is an opportunistic change).

CID: 1006826 [*]

git-svn-id: svn://svn.freebsd.org/base/stable/10@312054 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311390:
ngie [Fri, 13 Jan 2017 09:01:09 +0000 (09:01 +0000)]
MFC r311390:

snmp_table_fetch_async: don't leak `work` if snmp_pdu_send(..) fails

CID: 1017276

git-svn-id: svn://svn.freebsd.org/base/stable/10@312052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310892,r310894,r310989:
ngie [Fri, 13 Jan 2017 08:59:22 +0000 (08:59 +0000)]
MFC r310892,r310894,r310989:

r310892:

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

r310894:

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

r310989:

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@312050 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310729:
ngie [Fri, 13 Jan 2017 08:55:37 +0000 (08:55 +0000)]
MFC r310729:

Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free

snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that
could happen if a pdu was reused after calling the function, and
as both stack and heap allocation types are used in contrib/bsnmp
and usr.sbin/bsnmpd.

snmp_value_free: NULL out value->v.octetstring.octets after calling
free on it to prevent a double-free from occurring.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312047 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311733:
ngie [Fri, 13 Jan 2017 08:54:06 +0000 (08:54 +0000)]
MFC r311733:

Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)

git-svn-id: svn://svn.freebsd.org/base/stable/10@312045 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311290,r311293,r311294:
ngie [Fri, 13 Jan 2017 08:51:46 +0000 (08:51 +0000)]
MFC r311290,r311293,r311294:

r311290:

Use strlcpy instead of strcpy when copying the bridge name to ifr.ifr_name
to avoid buffer overflows

CID: 100673510067371006738

r311293:

bridge_do_pfctl: allocate mib_name dynamically using asprintf

This is being done to reduce wasted space, simplify complexity in
the code, and to quell a Coverity warning about buffer overruns.
warning about buffer overruns.

CID: 1006736

r311294:

style cleanup

- bridge_pf_dump: use nitems instead of spelling it out longhand
- bridge_do_pfctl: sort variables by alignment for type

git-svn-id: svn://svn.freebsd.org/base/stable/10@312044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311282:
ngie [Fri, 13 Jan 2017 08:49:22 +0000 (08:49 +0000)]
MFC r311282:

snmp_mibII(3) requires net/if.h and net/if_mib.h

Document that requirement

git-svn-id: svn://svn.freebsd.org/base/stable/10@312042 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311268:
ngie [Fri, 13 Jan 2017 08:48:17 +0000 (08:48 +0000)]
MFC r311268:

Clarify lifetime of child(..) function

Ensure child exits when complete as it's always run in a forked
process.

Add a missing break statement in :pselect_sigmask when calling
child(..) for clarity and to avoid weird domino effects if the
child process somehow does something it's not supposed to do
with the logfiles, file descriptors, etc

CID: 122336912233701300301

git-svn-id: svn://svn.freebsd.org/base/stable/10@312039 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311265,r311274:
ngie [Fri, 13 Jan 2017 08:46:49 +0000 (08:46 +0000)]
MFC r311265,r311274:

r311265:

fpu: ensure calls to pthread_create succeed and test sched_yield to make
sure it returns 0

sched_yield tests for values returning 0 of type int and sched_yield is
of type long, so the test is a mismatch

CID: 1254953125495412549651254966

r311274:

run: ensure pthread_condattr_{init,setclock} is successful

CID: 12686311268633

git-svn-id: svn://svn.freebsd.org/base/stable/10@312038 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311715:
ngie [Fri, 13 Jan 2017 08:42:11 +0000 (08:42 +0000)]
MFC r311715:

Use nitems({mib,name}) instead of hardcoding their value

git-svn-id: svn://svn.freebsd.org/base/stable/10@312036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311709:
ngie [Fri, 13 Jan 2017 08:40:58 +0000 (08:40 +0000)]
MFC r311709:

Style(9) fixes

- Sort sys/ #includes
- Use nitems instead of hardcoding the length of `mib`

git-svn-id: svn://svn.freebsd.org/base/stable/10@312034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311714:
ngie [Fri, 13 Jan 2017 08:39:40 +0000 (08:39 +0000)]
MFC r311714:

lib/libutil/kinfo_*: style cleanup

- Use nitems(mib) instead of hardcoding mib's length
- Sort sys/ #includes

git-svn-id: svn://svn.freebsd.org/base/stable/10@312032 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311870:
ngie [Fri, 13 Jan 2017 08:38:29 +0000 (08:38 +0000)]
MFC r311870:

Merge the grammar fix for lib/libc/gen/raise_test:raise_stress

git-svn-id: svn://svn.freebsd.org/base/stable/10@312030 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311871:
ngie [Fri, 13 Jan 2017 08:36:14 +0000 (08:36 +0000)]
MFC r311871:

Merge ^/vendor/NetBSD/tests/dist@r311868

This is the vendor accepted version of ^/head@r311245

git-svn-id: svn://svn.freebsd.org/base/stable/10@312028 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311511:
ngie [Fri, 13 Jan 2017 08:29:43 +0000 (08:29 +0000)]
MFC r311511:

Add integration makefile for contrib/bsnmp/gensnmpdef

It's a whole lot less error prone than generating the file completely
by hand.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312025 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311711,r311712,r311713:
ngie [Fri, 13 Jan 2017 08:27:40 +0000 (08:27 +0000)]
MFC r311711,r311712,r311713:

r311711:

Clean up trailing whitespace

r311712:

Sort #includes

r311713:

Use nitems(mib) instead of hardcoding mib's length

git-svn-id: svn://svn.freebsd.org/base/stable/10@312023 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r266773,r280680,r311710:
ngie [Fri, 13 Jan 2017 08:24:41 +0000 (08:24 +0000)]
MFC r266773,r280680,r311710:

r266773 (by jhb):

Fix a couple of size_t != int warnings.

r280680 (by kevlo):

Print size_t's with %zu rather than "%zd.

r311710:

Style fixes

- Delete trailing whitespace
- Use nitems(mib) instead of hardcoding the mib length

git-svn-id: svn://svn.freebsd.org/base/stable/10@312021 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310118
asomers [Thu, 12 Jan 2017 21:46:31 +0000 (21:46 +0000)]
MFC r310118

Fix ls_tests:o_flag with ZFS TMPDIR

Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is
updated. The test must explicitly clear uarch to be portable across
filesystems. Also, it doesn't need to run as root.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311998 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311447:
kib [Thu, 12 Jan 2017 01:20:51 +0000 (01:20 +0000)]
MFC r311447:
Some style fixes for getfstat(2)-related code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311959 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311706:
bapt [Wed, 11 Jan 2017 22:10:56 +0000 (22:10 +0000)]
MFC r311706:

Update pciids to 2017.01.08

git-svn-id: svn://svn.freebsd.org/base/stable/10@311944 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311688:
dim [Wed, 11 Jan 2017 21:01:49 +0000 (21:01 +0000)]
MFC r311688:

Fix logic error in gvinum's gv_set_sd_state()

With clang 4.0.0, I'm getting the following warnings:

    sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only
    applied to the left hand side of this bitwise operator
    [-Werror,-Wlogical-not-parentheses]
                    if (!flags & GV_SETSTATE_FORCE)
                        ^      ~

The logical not operator should obiously be called after masking.

Reviewed by: mav, pfg
Differential Revision: https://reviews.freebsd.org/D9093

git-svn-id: svn://svn.freebsd.org/base/stable/10@311939 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311649:
dim [Wed, 11 Jan 2017 20:45:27 +0000 (20:45 +0000)]
MFC r311649:

Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c:

    contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only
    applied to the left hand side of this bitwise operator
    [-Werror,-Wlogical-not-parentheses]
            if (!ifmr.ifm_status & IFM_AVALID) {
                ^                ~

Obviously, the masking needs to be done before the logical not
operation.  Add parentheses to make it so.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310703:
mav [Wed, 11 Jan 2017 07:46:01 +0000 (07:46 +0000)]
MFC r310703:
Pass proper arguments (handles, not directly structure pointers) to
scif_cb_domain_device_removed().

This should fix NULL dereference on task management function timeout.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311921 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311914: MFV r311913:
delphij [Wed, 11 Jan 2017 05:56:40 +0000 (05:56 +0000)]
MFC r311914: MFV r311913:

Fix multiple OpenSSH vulnerabilities.

Submitted by: des
Approved by: so

git-svn-id: svn://svn.freebsd.org/base/stable/10@311915 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r309252: Add more ASMedia PCI IDs from different sources.
mav [Tue, 10 Jan 2017 19:16:50 +0000 (19:16 +0000)]
MFC r309252: Add more ASMedia PCI IDs from different sources.

Exact device names are not clear, but its better then nothing at all.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311885 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r309251: Process port interrupt even is PxIS register is zero.
mav [Tue, 10 Jan 2017 19:15:37 +0000 (19:15 +0000)]
MFC r309251: Process port interrupt even is PxIS register is zero.

ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside
seems sometimes forgeting to set bits in PxIS, causing command timeouts.
Removal of this check fixes the issue by the theoretical cost of slightly
higher CPU usage in some odd cases, but this is what Linux does too.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311883 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310633: Add MAX_LUNS overflow safety checks.
mav [Tue, 10 Jan 2017 08:25:03 +0000 (08:25 +0000)]
MFC r310633: Add MAX_LUNS overflow safety checks.

While this MAX_LUNS limitation is too synthetic and should be removed,
it is better to enforce it while it is here.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r301027): fix 307 / 308 redirects
des [Tue, 10 Jan 2017 08:12:56 +0000 (08:12 +0000)]
MFH (r301027): fix 307 / 308 redirects
MFH (r310823): fix multi-line CONNECT responses

PR: 112515 173451 194483 209546

git-svn-id: svn://svn.freebsd.org/base/stable/10@311864 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFH (r267371, r297754, r299520): nits and style
des [Tue, 10 Jan 2017 08:08:49 +0000 (08:08 +0000)]
MFH (r267371, r297754, r299520): nits and style

git-svn-id: svn://svn.freebsd.org/base/stable/10@311863 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r257398 (by sbruno):
dim [Mon, 9 Jan 2017 20:14:02 +0000 (20:14 +0000)]
MFC r257398 (by sbruno):

Quiesce warnings by updating headerfile includes

r257404 | sbruno | 2013-10-30 23:41:18 +0100 (Wed, 30 Oct 2013) | 9 lines

Quiesce two warnings:

1.  define the CODE * as const
2.  restructure function to eliminate warning about exiting with no return.
    severity_map() never returns when it can't find an appropriate sysylog
    facility, and it longjmp()'s away into error code handling.  Keep this
    behavior by stashing the facility value found during our search and
    checking for -1 if found.

MFC r257405 (by sbruno):

Quiesce warning, which could be a bug IMO, by correctly defining the host_info
structure name

MFC r257406 (by sbruno):

Queisce warning about undeclared function usage.

yp_get_default_domain is defined in workaround.c but is not declared
in any header file.  Tie the declaration to the same #define conditional
used when the function is called, NETGROUP

MFC r311459:

Put proper prototypes in tcpd.h

Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:

    /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int hosts_access();              /* access control */
                           ^

To fix this, turn these declarations into real prototypes.  While here,
garbage collect the incompatible rfc931() function from scaffold.c, as
it is never used.

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

MFC r311461:

Also remove unnecessary extern keywords from tcpd.h.

Noticed by: kib

MFC r311556:

After r311459, some ports can break, because a few of the newly added
prototypes in <tcpd.h> use FILE.  Pull in a minimal forward declaration
of FILE from <stdio.h> to minimize impact.  Sorry for the breakage.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>

git-svn-id: svn://svn.freebsd.org/base/stable/10@311814 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310242:
hselasky [Mon, 9 Jan 2017 17:13:35 +0000 (17:13 +0000)]
MFC r310242:
Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
The panics happen due to using kernel facilities like callouts too early.

Tested by: jhb @

git-svn-id: svn://svn.freebsd.org/base/stable/10@311799 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310058:
hselasky [Mon, 9 Jan 2017 17:07:52 +0000 (17:07 +0000)]
MFC r310058:
Fix initialisation of mlx4_pci_table's .driver_data fields.

Differential Revision: https://reviews.freebsd.org/D8791
Sponsored by: Mellanox Technologies
Submitted by: Dexuan Cui <decui@microsoft.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@311795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310387:
hselasky [Mon, 9 Jan 2017 16:55:29 +0000 (16:55 +0000)]
MFC r310387:
Add more comments regarding collection of statistics counters.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@311791 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310388:
hselasky [Mon, 9 Jan 2017 16:47:39 +0000 (16:47 +0000)]
MFC r310388:
Make a read only pointer constant.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@311789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311113:
kib [Mon, 9 Jan 2017 10:31:39 +0000 (10:31 +0000)]
MFC r311113:
There is no need to use temporary statfs buffer for fsid obliteration
and prison enforcement.  Do it on the caller buffer directly.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311779 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311111:
kib [Mon, 9 Jan 2017 10:30:24 +0000 (10:30 +0000)]
MFC r311111:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311778 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311108:
kib [Mon, 9 Jan 2017 10:29:13 +0000 (10:29 +0000)]
MFC r311108:
Move common code from kern_statfs() and kern_fstatfs() into a new helper.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311777 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310615:
kib [Mon, 9 Jan 2017 10:18:34 +0000 (10:18 +0000)]
MFC r310615:
Change knlist_destroy() to assertion.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311773 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311055:
kib [Mon, 9 Jan 2017 10:13:53 +0000 (10:13 +0000)]
MFC r311055:
Remove unneeded externs keywords.  Reindent long lines.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311772 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311640
arybchik [Mon, 9 Jan 2017 08:12:22 +0000 (08:12 +0000)]
MFC r311640

sfxge(4): allow DMA descs to cross 4k boundary on EF10

Siena has limitation on maximum byte count and 4k boundary crosssing
(which is stricter than maximum byte count).
EF10 has limitation on maximum byte count only.

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311768 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311639
arybchik [Mon, 9 Jan 2017 08:11:16 +0000 (08:11 +0000)]
MFC r311639

sfxge(4): treat EFX_LINK_UNKOWN as link down

It is safer to consider EFX_LINK_UNKNOWN as link down.
link_mode is set to EFX_LINK_UNKNOWN on port stop and fini.

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311638
arybchik [Mon, 9 Jan 2017 08:10:12 +0000 (08:10 +0000)]
MFC r311638

sfxge(4): use SFXGE_LINK_UP() to report link up state

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311766 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310614: Don't assign rtjp twice.
delphij [Mon, 9 Jan 2017 06:07:44 +0000 (06:07 +0000)]
MFC r310614: Don't assign rtjp twice.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311756 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310611:
delphij [Mon, 9 Jan 2017 05:58:48 +0000 (05:58 +0000)]
MFC r310611:

 - pstat(8) does not accept any arguments other than getopt() args,
   so don't bother to adjust argc/argv after getopt() loop.
 - Make a string pointer constant.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311753 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310609: Don't use high precision clock for expiration as only second
delphij [Mon, 9 Jan 2017 05:52:30 +0000 (05:52 +0000)]
MFC r310609: Don't use high precision clock for expiration as only second
portion is used.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310608: Avoid use after free.
delphij [Mon, 9 Jan 2017 05:44:19 +0000 (05:44 +0000)]
MFC r310608: Avoid use after free.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311747 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311114:
ngie [Mon, 9 Jan 2017 01:31:12 +0000 (01:31 +0000)]
MFC r311114:

Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi

git-svn-id: svn://svn.freebsd.org/base/stable/10@311730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311112,r311115:
ngie [Mon, 9 Jan 2017 01:29:20 +0000 (01:29 +0000)]
MFC r311112,r311115:

r311112:

libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize
their building on the knob

r311115:

Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS
if MK_GSSAPI != "no"

git-svn-id: svn://svn.freebsd.org/base/stable/10@311729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311505:
ngie [Mon, 9 Jan 2017 01:12:32 +0000 (01:12 +0000)]
MFC r311505:

Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..)

git-svn-id: svn://svn.freebsd.org/base/stable/10@311725 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311384:
ngie [Mon, 9 Jan 2017 01:11:38 +0000 (01:11 +0000)]
MFC r311384:

op_usm_users: fix indentation in SNMP_OP_SET block

git-svn-id: svn://svn.freebsd.org/base/stable/10@311723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311382:
ngie [Mon, 9 Jan 2017 01:08:43 +0000 (01:08 +0000)]
MFC r311382:

Use calloc instead of malloc + memset(.., 0, ..)

git-svn-id: svn://svn.freebsd.org/base/stable/10@311721 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311393:
ngie [Mon, 9 Jan 2017 01:07:16 +0000 (01:07 +0000)]
MFC r311393:

OS_getSystemUptime: use nitems for calculating the number of elements
in a sysctl mib instead of hardcoding the number 2

git-svn-id: svn://svn.freebsd.org/base/stable/10@311720 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310984,r311102:
ngie [Mon, 9 Jan 2017 01:05:02 +0000 (01:05 +0000)]
MFC r310984,r311102:

r310984:

Use calloc instead of malloc + memset(.., 0, ..)

r311102 (by pfg):

Cleanup inelegant calloc(3) introduced in r310984.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311718 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.
jhb [Mon, 9 Jan 2017 00:09:19 +0000 (00:09 +0000)]
MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.

The kernel uses a few negative errno values for internal conditions
such as requesting a system call restart.  Normally these errno values
are not exposed to userland.  However, kdump needs access to these
values as some of then can be present in a ktrace system call return
record.  Previously kdump was defining _KERNEL to gain access to ehse
values, but was then having to manually declare 'errno' (and doing it
incorrectly).  Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL
and uses the system-provided declaration of errno.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r267546 (by alc):
kib [Sun, 8 Jan 2017 16:59:07 +0000 (16:59 +0000)]
MFC r267546 (by alc):
Tidy up the early parts of vm_map_insert().

MFC r267645 (by alc):
When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
corresponding flag(s) in the new map entry.
Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when
extending the stack in the downward direction.

MFC r267850 (by alc):
Place the check that blocks map entry coalescing on stack entries in
vm_map_simplify_entry().

MFC r267917 (by alc):
Delay the call to crhold() in vm_map_insert() until we know that we won't
have to undo it by calling crfree().
Eliminate an unnecessary variable from vm_map_insert().

MFC r311014:
Style fixes for vm_map_insert().

Tested by: pho

git-svn-id: svn://svn.freebsd.org/base/stable/10@311687 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311446: Fix bootverbose affecting code logic in r294558.
mav [Sun, 8 Jan 2017 08:52:53 +0000 (08:52 +0000)]
MFC r311446: Fix bootverbose affecting code logic in r294558.

Reported by:    Jilles Tjoelker <jilles@stack.nl>

git-svn-id: svn://svn.freebsd.org/base/stable/10@311673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306563: Decode arguments to truncate and ftruncate.
jhb [Sat, 7 Jan 2017 19:16:53 +0000 (19:16 +0000)]
MFC 306563: Decode arguments to truncate and ftruncate.

In particular, decode the off_t argument as a 64-bit argument to fix
decoding for 32-bit processes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311654 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310982:
kib [Sat, 7 Jan 2017 12:04:30 +0000 (12:04 +0000)]
MFC r310982:
Ansify vm/vm_pager.c.  Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311645 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310925:
kib [Sat, 7 Jan 2017 11:58:14 +0000 (11:58 +0000)]
MFC r310925:
Remove unused declaration.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311245:
ngie [Sat, 7 Jan 2017 09:45:00 +0000 (09:45 +0000)]
MFC r311245:

tty: don't leak s after opening it with openpty

CID: 978321

git-svn-id: svn://svn.freebsd.org/base/stable/10@311635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311247:
ngie [Sat, 7 Jan 2017 09:44:02 +0000 (09:44 +0000)]
MFC r311247:

mkfifoat_fd: close dfd after use to avoid leaking it

CID: 978286

git-svn-id: svn://svn.freebsd.org/base/stable/10@311632 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311248:
ngie [Sat, 7 Jan 2017 09:42:51 +0000 (09:42 +0000)]
MFC r311248:

mknodat_fd: close dfd after use to avoid leaking it

CID: 978287

git-svn-id: svn://svn.freebsd.org/base/stable/10@311631 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311235:
ngie [Sat, 7 Jan 2017 09:41:18 +0000 (09:41 +0000)]
MFC r311235:

ttyname_err: close fd if it was opened successfully

CID: 978292

git-svn-id: svn://svn.freebsd.org/base/stable/10@311628 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311240:
ngie [Sat, 7 Jan 2017 09:39:15 +0000 (09:39 +0000)]
MFC r311240:

kqueue_desc_passing: initialize m.msg_flags to 0

This mutes an uninitialized scalar warning from Coverity

CID: 979620

git-svn-id: svn://svn.freebsd.org/base/stable/10@311627 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311273:
ngie [Sat, 7 Jan 2017 09:37:32 +0000 (09:37 +0000)]
MFC r311273:

setrlimit_basic: don't leak buf; free it on completion

CID: 978311

git-svn-id: svn://svn.freebsd.org/base/stable/10@311625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311228:
ngie [Sat, 7 Jan 2017 09:27:42 +0000 (09:27 +0000)]
MFC r311228:

ftok_link: don't leak fd

CID: 978291

git-svn-id: svn://svn.freebsd.org/base/stable/10@311620 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311250:
ngie [Sat, 7 Jan 2017 09:26:34 +0000 (09:26 +0000)]
MFC r311250:

mincore_resid: free buf after use

CID: 978304

git-svn-id: svn://svn.freebsd.org/base/stable/10@311619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311271:
ngie [Sat, 7 Jan 2017 09:21:26 +0000 (09:21 +0000)]
MFC r311271:

stat_symlink: don't leak fd; close the file descriptor when done

CID: 978314

git-svn-id: svn://svn.freebsd.org/base/stable/10@311616 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311269:
ngie [Sat, 7 Jan 2017 09:19:51 +0000 (09:19 +0000)]
MFC r311269:

swapcontext1: test for getcontext(3) and swapcontext(3) success properly

The beforementioned libcalls both succeed if the return codes aren't -1

CID: 976790, 976791

git-svn-id: svn://svn.freebsd.org/base/stable/10@311613 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311249:
ngie [Sat, 7 Jan 2017 09:17:45 +0000 (09:17 +0000)]
MFC r311249:

{strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use

CID: 978299, 978300

git-svn-id: svn://svn.freebsd.org/base/stable/10@311611 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311272:
ngie [Sat, 7 Jan 2017 09:16:22 +0000 (09:16 +0000)]
MFC r311272:

revoke_perm: don't leak fd at the end of the test; close it

This code is unused on FreeBSD, but it mutes a valid Coverity warning
which would be true on NetBSD

CID: 978311

git-svn-id: svn://svn.freebsd.org/base/stable/10@311610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311246:
ngie [Sat, 7 Jan 2017 09:15:19 +0000 (09:15 +0000)]
MFC r311246:

fexecve: don't leak fd on fexecve(2) failure; close before calling err

CID: 978285

git-svn-id: svn://svn.freebsd.org/base/stable/10@311608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311270:
ngie [Sat, 7 Jan 2017 09:12:51 +0000 (09:12 +0000)]
MFC r311270:

pipe_restart: free f on function exit to quell complaint from Coverity

CID: 978307

git-svn-id: svn://svn.freebsd.org/base/stable/10@311606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311291:
ngie [Sat, 7 Jan 2017 09:11:18 +0000 (09:11 +0000)]
MFC r311291:

bridge_get_pfval: use nitems instead of spelling it out longhand

git-svn-id: svn://svn.freebsd.org/base/stable/10@311604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310501:
ngie [Sat, 7 Jan 2017 09:09:54 +0000 (09:09 +0000)]
MFC r310501:

Be more strict about IpAddress type in snmp_value_parse(..)

- Use inet_pton with AF_INET instead of doing longhand with sscanf.
- Use gethostbyname2 with AF_INET to ensure that the hostname isn't
  accidentally parsed with another address family, e.g. AF_INET6.

NB: IpAddress per RFC-2578 is IPv4 only. Work is in progress to add
    the InetAddress type and friends documented in RFC-4001 and
    elsewhere (which supports IPv4, IPv6, and more).

git-svn-id: svn://svn.freebsd.org/base/stable/10@311603 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310952:
ngie [Sat, 7 Jan 2017 08:53:58 +0000 (08:53 +0000)]
MFC r310952:

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

CID: 10068271006828

git-svn-id: svn://svn.freebsd.org/base/stable/10@311598 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310957,r310958,r310960:
ngie [Sat, 7 Jan 2017 08:48:51 +0000 (08:48 +0000)]
MFC r310957,r310958,r310960:

r310957:

Use strlcpy when copying `com` to pdu->community to avoid potential
buffer overruns

CID: 10068231006824

r310958:

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`

CID: 1006551

r310960:

Similar to r310954, set .len to 0 on malloc failure and to `len` only
on success

git-svn-id: svn://svn.freebsd.org/base/stable/10@311597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310497:
ngie [Sat, 7 Jan 2017 08:46:16 +0000 (08:46 +0000)]
MFC r310497:

Warning message cleanup

- Use warn instead of warnx + strerror(errno)
- Remove unnecessary trailing newline from a warnx call
- Add missing spaces following "," in syslog and warn* calls

git-svn-id: svn://svn.freebsd.org/base/stable/10@311595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310931,r310942,r310988:
ngie [Sat, 7 Jan 2017 08:44:15 +0000 (08:44 +0000)]
MFC r310931,r310942,r310988:

r310931:

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

CID: 1018247

r310942:

Unbreak the build by passing the string to strdup, not its length

Pointyhat to: ngie

r310988:

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@311593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310954,r310987,r311222:
ngie [Sat, 7 Jan 2017 08:28:41 +0000 (08:28 +0000)]
MFC r310954,r310987,r311222:

r310954:

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.

CID: 1007590

r310987:

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

CID: 1006392

r311222:

Fix logical inversion when checking result from calloc
in snmp_output_err_resp(..)

CID: 1368195

git-svn-id: svn://svn.freebsd.org/base/stable/10@311590 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311242:
ngie [Sat, 7 Jan 2017 08:25:09 +0000 (08:25 +0000)]
MFC r311242:

listen_low_port: check for errors from socket(2) before continuing

CID: 976778

git-svn-id: svn://svn.freebsd.org/base/stable/10@311589 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r311239:
ngie [Sat, 7 Jan 2017 08:18:25 +0000 (08:18 +0000)]
MFC r311239:

umask_open: don't leak fd on success

CID: 978315

git-svn-id: svn://svn.freebsd.org/base/stable/10@311587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoRegenerate src.conf(5)
ngie [Fri, 6 Jan 2017 21:34:02 +0000 (21:34 +0000)]
Regenerate src.conf(5)

git-svn-id: svn://svn.freebsd.org/base/stable/10@311554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFstable/11 r311551:
ngie [Fri, 6 Jan 2017 21:29:31 +0000 (21:29 +0000)]
MFstable/11 r311551:

MFC r311136:

Add WITH_SSP to silence complaints from mkman about there not being a file

git-svn-id: svn://svn.freebsd.org/base/stable/10@311552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC 306562: Handle 64-bit system call arguments (off_t, id_t).
jhb [Fri, 6 Jan 2017 20:32:34 +0000 (20:32 +0000)]
MFC 306562: Handle 64-bit system call arguments (off_t, id_t).

In particular, 64-bit system call arguments use up two register_t
arguments for 32-bit processes.  They must also be aligned on a 64-bit
boundary on 32-bit powerpc processes.  This fixes the decoding of
lseek(), procctl(), and wait6() arguments for 32-bit processes (both
native and via freebsd32).

Note that the ktrace system call return record only returns a single
register, so the return value of lseek is always truncated to the low
32-bits for 32-bit processes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

7 years agoMFC r310821:
kib [Fri, 6 Jan 2017 12:13:03 +0000 (12:13 +0000)]
MFC r310821:
Style.

git-svn-id: svn://svn.freebsd.org/base/stable/10@311516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f