]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoWhen sysctlbyname fails, free buf before returning.
Stephen J. Kiernan [Thu, 1 Jun 2017 16:44:39 +0000 (16:44 +0000)]
When sysctlbyname fails, free buf before returning.

Submitted by: Thomas Rix <trix@juniper.net>
Reviewed by: jhb
Approved by: sjg (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9867

7 years agoImprove comments to describe what the code does.
Michael Tuexen [Thu, 1 Jun 2017 15:11:18 +0000 (15:11 +0000)]
Improve comments to describe what the code does.

Reported by: jtl
Sponsored by: Netflix, Inc.

7 years agoUse proper capitalization with .Dd.
Edward Tomasz Napierala [Thu, 1 Jun 2017 15:03:43 +0000 (15:03 +0000)]
Use proper capitalization with .Dd.

Submitted by: oshogbo
MFC after: 2 weeks

7 years agoAllow communication between functions on the same host when using the
Hans Petter Selasky [Thu, 1 Jun 2017 10:44:48 +0000 (10:44 +0000)]
Allow communication between functions on the same host when using the
mlx4en(4) driver in SRIOV mode.

Place a copy of the destination MAC address in the send WQE only under
SRIOV/eSwitch configuration or when the device is in selftest. This
allows communication between functions on the same host.

PR: 216493
MFC after: 3 days
Sponsored by: Mellanox Technologies

7 years agoFree hardware queue resource after port is stopped in the mlx4en(4)
Hans Petter Selasky [Thu, 1 Jun 2017 10:39:00 +0000 (10:39 +0000)]
Free hardware queue resource after port is stopped in the mlx4en(4)
driver. Else if the port is up the resource might still be busy and
the MTT free will fail.

PR: 216493
MFC after: 3 days
Sponsored by: Mellanox Technologies

7 years agoBuild kdebug_secreplay() function only when IPSEC_DEBUG is defined.
Andrey V. Elsukov [Thu, 1 Jun 2017 10:04:12 +0000 (10:04 +0000)]
Build kdebug_secreplay() function only when IPSEC_DEBUG is defined.

This should fix the build on sparc.

Reported by: emaste
X-MFC with: r319118

7 years agoTranslate the ERESTARTSYS error code into ERESTART in the LinuxKPI
Hans Petter Selasky [Thu, 1 Jun 2017 09:53:55 +0000 (09:53 +0000)]
Translate the ERESTARTSYS error code into ERESTART in the LinuxKPI
ioctl(), read() and write() system call handlers. This error code is
internal to the kernel and should not be seen by user-space programs
according to Linux.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd generic kqueue() and kevent() support to the LinuxKPI character
Hans Petter Selasky [Thu, 1 Jun 2017 09:34:51 +0000 (09:34 +0000)]
Add generic kqueue() and kevent() support to the LinuxKPI character
devices. The implementation allows read and write filters to be
created and piggybacks on the poll() file operation to determine when
a filter should trigger. The piggyback mechanism is simply to check
for the EWOULDBLOCK or EAGAIN return code from read(), write() or
ioctl() system calls and then update the kqueue() polling state bits.
The implementation is similar to the one found in the cuse(3) module.
Refer to sys/fs/cuse/*.[ch] for more details.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoipfw.8: Note that the ipfw_nat kernel module must be loaded or that the
Emmanuel Vadot [Thu, 1 Jun 2017 09:14:49 +0000 (09:14 +0000)]
ipfw.8: Note that the ipfw_nat kernel module must be loaded or that the
IPFIREWALL_NAT options must be in the kernel config in order to use in-kernel
nat.

MFC after: 3 days

7 years ago * limit size of buffers to RPC_MAXDATASIZE
Xin LI [Thu, 1 Jun 2017 06:12:25 +0000 (06:12 +0000)]
 * limit size of buffers to RPC_MAXDATASIZE
 * don't leak memory
 * be more picky about bad parameters

From:

https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt
https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt

via NetBSD.

Reviewed by: emaste, cem (earlier version)
Differential Revision: https://reviews.freebsd.org/D10922
MFC after: 3 days

7 years agoWelcome back bapt@ to portmgr
Rene Ladan [Thu, 1 Jun 2017 02:31:14 +0000 (02:31 +0000)]
Welcome back bapt@ to portmgr

7 years agoMerge ACPICA 20170531.
Jung-uk Kim [Thu, 1 Jun 2017 00:01:19 +0000 (00:01 +0000)]
Merge ACPICA 20170531.

7 years agoImport ACPICA 20170531.
Jung-uk Kim [Wed, 31 May 2017 22:40:24 +0000 (22:40 +0000)]
Import ACPICA 20170531.

7 years agoparse.c parse_string
Stephen J. Kiernan [Wed, 31 May 2017 21:31:15 +0000 (21:31 +0000)]
parse.c parse_string
When parse_semi fails, free s before returning

parse.c parse_numeric_aggregate
The memory assigned to bufp is complicated, it can either be from the input
parameter buf or allocated locally. Introduce a new variable lbufp to track
when it is assigned locally and to free it when appropriate.

Submitted by: Thomas Rix <trix@juniper.net>
Reviewed by: jhb
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9899

7 years agoAdd MD_VERIFY option to enable O_VERIFY in open for vnode type.
Stephen J. Kiernan [Wed, 31 May 2017 21:18:11 +0000 (21:18 +0000)]
Add MD_VERIFY option to enable O_VERIFY in open for vnode type.
Add -o [no]verify option to mdconfig (and document in man page.)
Implement GEOM attribute MNT::verified to ask md if the backing vnode is
  verified.
Check for MNT::verified in cd9660 mount to flag the mount as MNT_VERIFIED if
  the underlying device has been verified.

Reviewed by: rwatson
Approved by: sjg (mentor)
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D2902

7 years agoMinor code optimisation.
Hans Petter Selasky [Wed, 31 May 2017 21:05:24 +0000 (21:05 +0000)]
Minor code optimisation.
Avoid locking the global CUSE lock when the polling flags are zero.

MFC after: 1 week

7 years agoMFV: r319352
Jung-uk Kim [Wed, 31 May 2017 19:37:23 +0000 (19:37 +0000)]
MFV: r319352

Merge byacc 20170430.

7 years agoImport byacc 20170430.
Jung-uk Kim [Wed, 31 May 2017 19:27:37 +0000 (19:27 +0000)]
Import byacc 20170430.

7 years agoFix typo in Driver Type A/C/D capability checks in sdhci.
Imre Vadász [Wed, 31 May 2017 19:20:27 +0000 (19:20 +0000)]
Fix typo in Driver Type A/C/D capability checks in sdhci.

Use the SDHCI_CAN_DRIVE_TYPE_A/_C/_D masks to check for Driver Type support,
instead of using the SDHCI_CTRL2_DRIVER_TYPE_A/_C/_D values which are meant
for setting the Driver Type in the HOST_CONTROL2 register.

Approved by: adrian (mentor), jmcneill
Differential Revision: https://reviews.freebsd.org/D10999

7 years ago[ar71xx] rename AR724X_BASE -> std.AR724X
Adrian Chadd [Wed, 31 May 2017 16:32:33 +0000 (16:32 +0000)]
[ar71xx] rename AR724X_BASE -> std.AR724X

7 years agomakefs: free buf in case of error
Ed Maste [Wed, 31 May 2017 16:28:29 +0000 (16:28 +0000)]
makefs: free buf in case of error

CID: 270190
Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Reported by: Coverity
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11011

7 years agoImplement print_hex_dump(), print_hex_dump_bytes() and
Hans Petter Selasky [Wed, 31 May 2017 16:24:02 +0000 (16:24 +0000)]
Implement print_hex_dump(), print_hex_dump_bytes() and
printk_ratelimited() in the LinuxKPI.

While at it fix the inclusion guard of printk.h to be similar to the
rest of the LinuxKPI header files.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoProperly implement idr_preload() and idr_preload_end() in the
Hans Petter Selasky [Wed, 31 May 2017 16:08:30 +0000 (16:08 +0000)]
Properly implement idr_preload() and idr_preload_end() in the
LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix integer overflow detection in dd
Alan Somers [Wed, 31 May 2017 16:07:32 +0000 (16:07 +0000)]
Fix integer overflow detection in dd

dd(1) tried to detect whether the seek offset would overflow, but it failed
to account for the case where the provided argument was negative and the
file was a regular file (negative seeks are allowed for character devices).
I fixed it, and added a regression test.

Reported by: Coverity
CID: 1368659
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

7 years agoImplement in_atomic() function in the LinuxKPI.
Hans Petter Selasky [Wed, 31 May 2017 15:05:44 +0000 (15:05 +0000)]
Implement in_atomic() function in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix integer overflow in "camcontrol format"
Alan Somers [Wed, 31 May 2017 14:59:03 +0000 (14:59 +0000)]
Fix integer overflow in "camcontrol format"

Reported by: Coverity
CID: 1011426
MFC after: 1 week
Sponsored by: Spectra Logic Corp

7 years agoFix uninitialized variable in bootparamd.c
Alan Somers [Wed, 31 May 2017 14:53:50 +0000 (14:53 +0000)]
Fix uninitialized variable in bootparamd.c

Restore line that was accidentally deleted in change 318790

Reported by: Coverity
CID: 1375855
MFC after: 1 week
X-MFC-With: 318790
Sponsored by: Spectra Logic Corp

7 years agoProperly set the .d_name field in the cdevsw structure for the
Hans Petter Selasky [Wed, 31 May 2017 13:11:06 +0000 (13:11 +0000)]
Properly set the .d_name field in the cdevsw structure for the
LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoMake sure the VMAP's "vm_file" field is referenced in a Linux
Hans Petter Selasky [Wed, 31 May 2017 13:07:05 +0000 (13:07 +0000)]
Make sure the VMAP's "vm_file" field is referenced in a Linux
compatible way by the linux_dev_mmap_single() function in the
LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoRemove the VMA handle from its list before calling the LinuxKPI VMA
Hans Petter Selasky [Wed, 31 May 2017 13:05:54 +0000 (13:05 +0000)]
Remove the VMA handle from its list before calling the LinuxKPI VMA
close operation to prevent other threads from reusing the VM object
handle pointer.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoDon't acquire a reference on the VM-space when allocating the LinuxKPI
Hans Petter Selasky [Wed, 31 May 2017 13:01:27 +0000 (13:01 +0000)]
Don't acquire a reference on the VM-space when allocating the LinuxKPI
task structure to avoid deadlock when tearing down the VM object
during a process exit.

Found by: markj @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix a reference count leak in the LinuxKPI due to calling VM open when
Hans Petter Selasky [Wed, 31 May 2017 12:08:25 +0000 (12:08 +0000)]
Fix a reference count leak in the LinuxKPI due to calling VM open when
it shouldn't be called.

Background:
The Linux VM open operation is called when a new VMA is
created on top of the current VMA. This is done through either mremap
flow or split_vma, usually due to mlock, madvise, munmap and so
on. This is currently not supported by the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFixes for refcounting "struct linux_file" in the LinuxKPI.
Hans Petter Selasky [Wed, 31 May 2017 12:02:59 +0000 (12:02 +0000)]
Fixes for refcounting "struct linux_file" in the LinuxKPI.

- Allow "struct linux_file" to be refcounted when its "_file" member
  is NULL by using its "f_count" field. The reference counts are
  transferred to the file structure when the file descriptor is
  installed.

- Add missing vdrop() calls for error cases during open().

- Set the "_file" member of "struct linux_file" during open. This
allows use of refcounting through get_file() and fput() with LinuxKPI
character devices.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoMake sure the thread's priority is restored for all three cases inside
Hans Petter Selasky [Wed, 31 May 2017 10:01:15 +0000 (10:01 +0000)]
Make sure the thread's priority is restored for all three cases inside
linux_synchronize_rcu_cb() in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpdate the usr.bin/mkimg golden test output files after ^/head@r319125
Enji Cooper [Wed, 31 May 2017 08:01:12 +0000 (08:01 +0000)]
Update the usr.bin/mkimg golden test output files after ^/head@r319125

^/head@r319125 changed the location of the backup pmbr, requiring the
output files to be regenerated, since they're binary disk dumps.

The output files were regenerated with "make rebase"--fixed in
^/head@r319294.

MFC with: r319125, r319294
PR: 219673
Sponsored by: Dell EMC Isilon

7 years agoFix "make rebase" after ^/head@r315776
Enji Cooper [Wed, 31 May 2017 07:49:49 +0000 (07:49 +0000)]
Fix "make rebase" after ^/head@r315776

"make rebase" can be used for rebasing the output files from mkimg
after making a change to mkimg. This will come in handy soon, per
bug 219673.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoFormalize the dependent/dependency relationship for <foo>.gz.uu vs <foo>
Enji Cooper [Wed, 31 May 2017 07:42:14 +0000 (07:42 +0000)]
Formalize the dependent/dependency relationship for <foo>.gz.uu vs <foo>

This helps ensure that the output files are regenerated if the input files
change, after the output files have been created.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years ago- Add a simple example to uname(1) manual page to show how the hardware
Alexey Dokuchaev [Wed, 31 May 2017 03:44:31 +0000 (03:44 +0000)]
- Add a simple example to uname(1) manual page to show how the hardware
  platform (returned by -m) can be different from the machine's processor
  architecture (-p)
- Document that make(1) sets universal MACHINE and MACHINE_ARCH variables
  based on these values

Reviewed by: imp, manpages (bjk)
Approved by: bjk, imp (implied)
Differential Revision: https://reviews.freebsd.org/D10489

7 years agoRemove NORESOLVE (-R) option from poollist() (ippool -l). It is not
Cy Schubert [Wed, 31 May 2017 03:11:25 +0000 (03:11 +0000)]
Remove NORESOLVE (-R) option from poollist() (ippool -l). It is not
used in poollist().

7 years agoFix bug in r318997: remove the line which overrides vn_fsid()
Konstantin Belousov [Tue, 30 May 2017 21:20:54 +0000 (21:20 +0000)]
Fix bug in r318997: remove the line which overrides vn_fsid()
calculation.

Noted by: jhb
Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation

7 years agoRegenerate src.conf(5)
Enji Cooper [Tue, 30 May 2017 18:06:19 +0000 (18:06 +0000)]
Regenerate src.conf(5)

This contains a number of content changes due to src.opts.mk changes.

Sponsored by: Dell EMC Isilon

7 years agoUse .Xr to reference libblacklist(3), blacklistctl(8), and blacklistd(8)
Enji Cooper [Tue, 30 May 2017 18:03:34 +0000 (18:03 +0000)]
Use .Xr to reference libblacklist(3), blacklistctl(8), and blacklistd(8)

MFC after: now
Sponsored by: Dell EMC Isilon

7 years agoAdd some miscellaneous definitions to support DRM drivers.
Mark Johnston [Tue, 30 May 2017 17:16:08 +0000 (17:16 +0000)]
Add some miscellaneous definitions to support DRM drivers.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10985

7 years agoadd a rescue/sh sanity check before installworld on the running system
Ed Maste [Tue, 30 May 2017 15:51:48 +0000 (15:51 +0000)]
add a rescue/sh sanity check before installworld on the running system

FreeBSD does not guarantee kernel forward compatibility (that is,
running a newer userland on an older kernel).  The documented upgrade
procedure specifies that installkernel should be performed, followed by
a reboot and then installworld.  As a sanity check when installing onto
the running system (DESTDIR is / or unset), attempt to run "sh echo OK"
using rescue from the objdir.  If rescue fails (e.g., because the system
has not been rebooted and the "old" kernel lacks a system call required
by the to-be-installed world), abort the installation.

This should avoid ino64 foot-shooting when the proper upgrade procedure
is not followed.

Reviewed by: allanjude, gjb, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10987

7 years agoFix an unnecessary/incorrect check in the PKTOPT_EXTHDRCPY macro.
Jonathan T. Looney [Tue, 30 May 2017 14:50:28 +0000 (14:50 +0000)]
Fix an unnecessary/incorrect check in the PKTOPT_EXTHDRCPY macro.

This macro allocates memory and, if malloc does not return NULL, copies
data into the new memory. However, it doesn't just check whether malloc
returns NULL. It also checks whether we called malloc with M_NOWAIT. That
is not necessary.

While it may be that malloc() will only return NULL when the M_NOWAIT flag
is set, we don't need to check for this when checking malloc's return
value. Further, in this case, the check was not completely accurate,
because it checked for flags == M_NOWAIT, rather than treating it as a bit
field and checking for (flags & M_NOWAIT).

Reviewed by: ae
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D10942

7 years agoFix two places in the ICMP6 code where we could dereference a NULL pointer
Jonathan T. Looney [Tue, 30 May 2017 14:41:31 +0000 (14:41 +0000)]
Fix two places in the ICMP6 code where we could dereference a NULL pointer
in the icmp6_input() function.

When processing an ICMP6_ECHO_REQUEST, if IP6_EXTHDR_GET fails, it will
set nicmp6 and n to NULL. Therefore, we should condition our modification
to nicmp6 on n being not NULL.

And, when processing an ICMP6_WRUREQUEST in the (mode != FQDN) case, if
m_dup_pkthdr() fails, the code will set n to NULL. However, the very next
line dereferences n. Therefore, when m_dup_pkthdr() fails, we should
discontinue further processing and follow the same path as when m_gethdr()
fails.

Reported by: clang static analyzer
Reviewed by: ae
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D10941

7 years agoEnforce the limit on ICMP messages before doing work to formulate the
Jonathan T. Looney [Tue, 30 May 2017 14:32:44 +0000 (14:32 +0000)]
Enforce the limit on ICMP messages before doing work to formulate the
response.

Delete an unneeded rate limit for UDP under IPv6. Because ICMP6
messages have their own rate limit, it is unnecessary to apply a
second rate limit to UDP messages.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D10387

7 years agofix indentation
Andriy Gapon [Tue, 30 May 2017 13:53:03 +0000 (13:53 +0000)]
fix indentation

MFC after: 4 days

7 years agoIntroduce additional locks when releasing TX resources and buffers in ENA
Zbigniew Bodek [Tue, 30 May 2017 12:00:56 +0000 (12:00 +0000)]
Introduce additional locks when releasing TX resources and buffers in ENA

There could be race condition with TX cleaning routine when cleaning mbufs,
when it was called directly from main sending thread (ena_mq_start).

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10927

7 years agoMove ENA's hw stats updating routine to separate task
Zbigniew Bodek [Tue, 30 May 2017 11:58:51 +0000 (11:58 +0000)]
Move ENA's hw stats updating routine to separate task

Initially, stats were being updated each time OS was requesting for
the first statistic.
To read statistics from hw, condvar was used. cv_timedwait cannot be
called when unsleepable lock is held, and this happens when FreeBSD
is requesting statistic.
Seperate task is reading statistics from NIC each 1 second.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10926

7 years agoAdd error handling to the ENA driver if init of the reset task fails
Zbigniew Bodek [Tue, 30 May 2017 11:56:54 +0000 (11:56 +0000)]
Add error handling to the ENA driver if init of the reset task fails

Also, to simplify cleaning routine, reset task is initialized before
allocating statistics and other resources.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10925

7 years agoAdd locks before each ena_up and ena_down
Zbigniew Bodek [Tue, 30 May 2017 11:55:02 +0000 (11:55 +0000)]
Add locks before each ena_up and ena_down

Lock only ena_up and ena_down calls in ioctl handler, instead of whole
ioctl. Locking ioctl with sx lock that is sleepable, is not allowed in
some cases, e.g. when multicast options are being changed.
Additional locking was added in deatch function to prevent race condition
with ioctl function.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10924

7 years agoAdd mbuf defragmentation to the ENA driver
Zbigniew Bodek [Tue, 30 May 2017 11:53:18 +0000 (11:53 +0000)]
Add mbuf defragmentation to the ENA driver

When mbuf chain is too long and device cannot handle that number
of segments in DMA transaction, mbuf chain will be defragmented.
Initially, driver was dropping all mbuf chains that were exceeding
supported number of segments.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10923

7 years agomtx: fix whitespace damage in _mtx_trylock_flags_
Mateusz Guzik [Tue, 30 May 2017 02:25:47 +0000 (02:25 +0000)]
mtx: fix whitespace damage in _mtx_trylock_flags_

MFC after: 3 days

7 years agopsm: add support for evdev protocol
Vladimir Kondratyev [Mon, 29 May 2017 20:43:00 +0000 (20:43 +0000)]
psm: add support for evdev protocol

Both relative and absolute multitouch modes are supported.
To enable psm(4) evdev support one should:
1. Add `device evdev` and `options EVDEV_SUPPORT` to kernel config file
2. Add hw.psm.elantech_support=1 or hw.psm.synaptics_support=1 to
   /boot/loader.conf for activation of absolute mode on touchpads
3. Add kern.evdev.rcpt_mask=12 to /etc/sysctl.conf to enable psm event
   sourcing and disable sysmouse

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10265
Tested by: wulf, Jan Kokemueller (Lenovo devs)

7 years agoAlso add libzfs and libmilter to the 64-bit inode library bump list.
Koop Mast [Mon, 29 May 2017 20:27:31 +0000 (20:27 +0000)]
Also add libzfs and libmilter to the 64-bit inode library bump list.
Make the comment more generic.

Approved by: emaste@

7 years ago64-bit inode commit bumped libarchive library version, record the old one.
Koop Mast [Mon, 29 May 2017 20:11:27 +0000 (20:11 +0000)]
64-bit inode commit bumped libarchive library version, record the old one.

Approved by: emaste@

7 years ago:dnvlist_get_string__default_value: fix a bogus string comparison test
Enji Cooper [Mon, 29 May 2017 19:02:52 +0000 (19:02 +0000)]
:dnvlist_get_string__default_value: fix a bogus string comparison test

Check actual_value vs "5", not "5" vs itself.

MFC after: 3 days
Reported by: Coverity
CID: 1362021
Sponsored by: Dell EMC Isilon

7 years agologarithm_test: assert that feclearexcept succeeds
Enji Cooper [Mon, 29 May 2017 18:49:28 +0000 (18:49 +0000)]
logarithm_test: assert that feclearexcept succeeds

This helps ensure that test preconditons are fulfilled.

MFC after: 3 days
Reported by: Coverity
CID: 1346572
Sponsored by: Dell EMC Isilon

7 years agofma_test: mute a warning about unreachable code on amd64 by restructuring
Enji Cooper [Mon, 29 May 2017 18:45:10 +0000 (18:45 +0000)]
fma_test: mute a warning about unreachable code on amd64 by restructuring
the #ifdef block to only handle the rest of the logic in the loop in the
#else case.

MFC after: 3 days
Reported by: Coverity
CID: 1346844
Sponsored by: Dell EMC Isilon

7 years ago:nvlist_unpack__duplicate_key : check the result of nvlist_pack(3)
Enji Cooper [Mon, 29 May 2017 18:39:28 +0000 (18:39 +0000)]
:nvlist_unpack__duplicate_key : check the result of nvlist_pack(3)

This fixes a potential NULL pointer dereference.

MFC after: 3 days
Reported by: Coverity
CID: 1362051
Sponsored by: Dell EMC Isilon

7 years agolib/libnv/tests/dnv_test: fix memory leaks for memory allocated via
Enji Cooper [Mon, 29 May 2017 18:34:45 +0000 (18:34 +0000)]
lib/libnv/tests/dnv_test: fix memory leaks for memory allocated via
either strdup or one of the dnvlist* libcalls.

Reported by: Coverity
CID: 1362056-1362060
Sponsored by: Dell EMC Isilon

7 years agoDocument direct execution mode for rtld.
Konstantin Belousov [Mon, 29 May 2017 13:38:26 +0000 (13:38 +0000)]
Document direct execution mode for rtld.

Reviewed by: emaste, jonathan (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D10826

7 years agoCorrect explanation of the dynamic tokens handling.
Konstantin Belousov [Mon, 29 May 2017 13:36:32 +0000 (13:36 +0000)]
Correct explanation of the dynamic tokens handling.

Reviewed by: emaste, jonathan
Sponsored by: The FreeBSD Foundation
X-Differential Revision: https://reviews.freebsd.org/D10826

7 years agobsdgrep: bump version number and add Kyle Evans copyright
Ed Maste [Mon, 29 May 2017 13:10:01 +0000 (13:10 +0000)]
bsdgrep: bump version number and add Kyle Evans copyright

The following changes have been made over the last couple of months:

Features:

 - With bsdgrep -r, the working directory is implied if no directory is
   specified
 - bsdgrep will now behave as bsdgrep -r does when it's named rgrep
 - bsdgrep now understands -z/--null-data to use \0 as EOL
 - GNU regex compatibility is now indicated with a "GNU compatible" in
   the version string

Fixes:

 - --mmap no longer hangs when coming across an EOF without an
   accompanying EOL
 - -o/--color matching generally improved, now produces earliest /
   longest matches
 - Context output now more closely aligns with GNU grep
 - Zero-length matches no longer exhibit broken behavior
 - Every output line now honors -b/-H/-n flags

Tests have been added for previous regressions as well as other
previously untested behaviors.

Various other fixes have been commited, and refactoring for further /
later improvements has taken place.

(The original submission changed the version string to 2.5.2, but I
decided to use 2.6.0 to reflect the addition of new features.)

Submitted by: Kyle Evans <kevans91@ksu.edu>
Differential Revision: https://reviews.freebsd.org/D10982

7 years agomkimg: Correct an off by one error in the PMBR size
Emmanuel Vadot [Mon, 29 May 2017 12:51:02 +0000 (12:51 +0000)]
mkimg: Correct an off by one error in the PMBR size

The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec
2.6 page 118 table 17).
This fixes warning printed by linux tools like parted or fdisk.

Sponsored by: Gandi.net

7 years agoDisable IPsec debugging code by default when IPSEC_DEBUG kernel option
Andrey V. Elsukov [Mon, 29 May 2017 09:30:38 +0000 (09:30 +0000)]
Disable IPsec debugging code by default when IPSEC_DEBUG kernel option
is not specified.

Due to the long call chain IPsec code can produce the kernel stack
exhaustion on the i386 architecture. The debugging code usually is not
used, but it requires a lot of stack space to keep buffers for strings
formatting. This patch conditionally defines macros to disable building
of IPsec debugging code.

IPsec currently has two sysctl variables to configure debug output:
 * net.key.debug variable is used to enable debug output for PF_KEY
   protocol. Such debug messages are produced by KEYDBG() macro and
   usually they can be interesting for developers.
 * net.inet.ipsec.debug variable is used to enable debug output for
   DPRINTF() macro and ipseclog() function. DPRINTF() macro usually
   is used for development debugging. ipseclog() function is used for
   debugging by administrator.

The patch disables KEYDBG() and DPRINTF() macros, and formatting buffers
declarations when IPSEC_DEBUG is not present in kernel config. This reduces
stack requirement for up to several hundreds of bytes.
The net.inet.ipsec.debug variable still can be used to enable ipseclog()
messages by administrator.

PR: 219476
Reported by: eugen
No objection from: #network
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10869

7 years agoIntroduce Genesys GL3224 quirks
Wojciech Macek [Mon, 29 May 2017 09:22:53 +0000 (09:22 +0000)]
Introduce Genesys GL3224 quirks

The Genesys chip is failing when issueing READ_CAP(16) command.
Force a quirk to disable it and use READ_CAP(10) instead.

Also, depending on used firmware, GL3224 can be recognized
either as 'storage device' or 'mass storage class' -
enable both variants in scsi_quirk_table.

Submitted by:    Wojciech Macek <wma@semihalf.com>
                 Konrad Adamczyk <ka@semihalf.com>
Obtained from:   Semihalf
Sponsored by:    Stormshield
Reviewed by:     mav
Differential revision: https://reviews.freebsd.org/D10902

7 years agoIncrease timeout in Atheros HAL
Wojciech Macek [Mon, 29 May 2017 09:21:38 +0000 (09:21 +0000)]
Increase timeout in Atheros HAL

It turned out, that some models of the Atheros PCIe
adapters (e.g. AR983x family) may fail to attach
due to insufficient timeout value.

Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Stormshield
Reviewed by:    adrian
Differential revision: https://reviews.freebsd.org/D10903

7 years agoEnable wireless Atheros cards in ARMADA38X
Wojciech Macek [Mon, 29 May 2017 09:20:20 +0000 (09:20 +0000)]
Enable wireless Atheros cards in ARMADA38X

Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
                Dominik Ermel <der@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Stormshield
Differential revision: https://reviews.freebsd.org/D10904

7 years ago[AP93] fix up the arge0/arge1 hints.
Adrian Chadd [Mon, 29 May 2017 07:57:01 +0000 (07:57 +0000)]
[AP93] fix up the arge0/arge1 hints.

7 years ago[ar71xx] [ar724x] update to work
Adrian Chadd [Mon, 29 May 2017 07:30:07 +0000 (07:30 +0000)]
[ar71xx] [ar724x] update to work

* add EARLY_PRINTF for debugging
* update module list to be much larger
* add random, otherwise well, stuff doesn't work.
* IPFIREWALL_DEFAULT_TO_ACCEPT

Tested:

* AP93 (AR7240 + AR9280)

TODO:

* rename to std.AR724X
* unify the built module list between all of the mips24k/mips74k atheros config files -
  now that the HAL, hwpmc, USB, etc are per-chip/per-arch modules it is easy to just
  compile them all and only include the ones you care about.

7 years agoUpdate AP93 support to the new world order.
Adrian Chadd [Mon, 29 May 2017 07:27:08 +0000 (07:27 +0000)]
Update AP93 support to the new world order.

* Map change: create a combined kernel+rootfs image.  The instructions I'll post
  on the wiki (which will be for a very outdated dev board, but at least will
  explain the what/why for posterity) will include how to reset the boot command.

Tested:

* AP93 dev board (AR7240 + AR9280)

7 years agoRevert r318789. It causes hanging NAT tcp sessions.
Cy Schubert [Mon, 29 May 2017 07:15:28 +0000 (07:15 +0000)]
Revert r318789. It causes hanging NAT tcp sessions.

7 years agozfs_lookup: fix bogus arguments to lookup of "snapshot" directory
Andriy Gapon [Mon, 29 May 2017 06:30:34 +0000 (06:30 +0000)]
zfs_lookup: fix bogus arguments to lookup of "snapshot" directory

When a parent directory lookup is done at the root of a snapshot mounted
under .zfs/snapshot directory, we need to look up that directory in
the parent filesystem.  We achieve that by doing a VOP_LOOKUP operation
on a .zfs vnode with "snapshot" as a target name.  But previously we
also passed ISDOTDOT flag to the lookup and, because of that, the lookup
actually returned the parent of the .zfs vnode, that is, a root vnode of
the parent filesystem.

Reported by: lev
Tested by: lev
MFC after: 3 days

7 years agortwn: fix connection problems with 'options RTWN_WITHOUT_UCODE'
Andriy Voskoboinyk [Sun, 28 May 2017 22:51:06 +0000 (22:51 +0000)]
rtwn: fix connection problems with 'options RTWN_WITHOUT_UCODE'

sc_set_media_status() callback may involve some generic code in addition to
firmware-specific part (e.g., link status register setup for RTL8188E);
so, remove 'RTWN_WITHOUT_UCODE' ifdefs around it.

Tested with RTL8188CUS, RTL8188EU and RTL8821AU, STA mode.

7 years agortwn_usb: fix build with 'options RTWN_WITHOUT_UCODE'
Andriy Voskoboinyk [Sun, 28 May 2017 22:38:19 +0000 (22:38 +0000)]
rtwn_usb: fix build with 'options RTWN_WITHOUT_UCODE'

7 years agoMention that the basep argument to getdirentries(2) can be NULL.
Konstantin Belousov [Sun, 28 May 2017 21:42:47 +0000 (21:42 +0000)]
Mention that the basep argument to getdirentries(2) can be NULL.

Noted by: dim
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D10972

7 years agouse the same option list for dhcp discovery and request
Toomas Soome [Sun, 28 May 2017 21:30:01 +0000 (21:30 +0000)]
use the same option list for dhcp discovery and request

The DHCP client is supposed to use the same option request list for
both DHCP discovery and request.

This will also allow us to fill the list in single function.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10981

7 years agoSmall cleanup in dev_net.c
Toomas Soome [Sun, 28 May 2017 21:20:55 +0000 (21:20 +0000)]
Small cleanup in dev_net.c

The variable servip is unused. One leftover printf and small cstyle nit.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10980

7 years agoFollowup on the user-class changes
Baptiste Daroussin [Sun, 28 May 2017 18:31:13 +0000 (18:31 +0000)]
Followup on the user-class changes

Reported by: Jose Luis Duran (via github)

7 years ago.Xr mount.conf(5) from boot(8).
Edward Tomasz Napierala [Sun, 28 May 2017 18:13:44 +0000 (18:13 +0000)]
.Xr mount.conf(5) from boot(8).

MFC after: 2 weeks

7 years agoFix Xrs; they were pointing to the wrong section.
Edward Tomasz Napierala [Sun, 28 May 2017 18:09:49 +0000 (18:09 +0000)]
Fix Xrs; they were pointing to the wrong section.

MFC after: 2 weeks

7 years agoMove mount.conf(8) to mount.conf(5); it's a kernel configuration file
Edward Tomasz Napierala [Sun, 28 May 2017 18:07:53 +0000 (18:07 +0000)]
Move mount.conf(8) to mount.conf(5); it's a kernel configuration file
and not an administrative utility.

MFC after: 2 weeks

7 years agoTweak r319058 slightly
Enji Cooper [Sun, 28 May 2017 17:50:29 +0000 (17:50 +0000)]
Tweak r319058 slightly

- Specify an explicit mode when using O_CREAT per open(2).
- Fix the error message (add missing enclosing parentheses).

Submitted by: jilles
MFC after: 3 days
MFC with: r319058
Sponsored by: Dell EMC Isilon

7 years agoFix potential memory leak.
Pedro F. Giffuni [Sun, 28 May 2017 17:48:54 +0000 (17:48 +0000)]
Fix potential memory leak.

Moving the allocation forward, just before it's actually needed, seems
sensible.
Add newline character at the last line while here.

Reported by: pluknet
Differential Revision: https://reviews.freebsd.org/D10974

7 years agoDeclutter rctl(8) by moving kernel build instructions into newly
Edward Tomasz Napierala [Sun, 28 May 2017 17:25:47 +0000 (17:25 +0000)]
Declutter rctl(8) by moving kernel build instructions into newly
created rctl(4).

MFC after: 2 weeks

7 years agoRandom tweaks to rctl(8).
Edward Tomasz Napierala [Sun, 28 May 2017 17:13:38 +0000 (17:13 +0000)]
Random tweaks to rctl(8).

MFC after: 2 weeks

7 years agoMinor tweaks to iscsi(4) and iscsid(8).
Edward Tomasz Napierala [Sun, 28 May 2017 17:02:29 +0000 (17:02 +0000)]
Minor tweaks to iscsi(4) and iscsid(8).

MFC after: 2 weeks

7 years agoRandom tweaks to cfiscsi(4) man page.
Edward Tomasz Napierala [Sun, 28 May 2017 16:53:21 +0000 (16:53 +0000)]
Random tweaks to cfiscsi(4) man page.

MFC after: 2 weeks

7 years agoMake ctld(8) mention cfiscsi(4).
Edward Tomasz Napierala [Sun, 28 May 2017 16:41:42 +0000 (16:41 +0000)]
Make ctld(8) mention cfiscsi(4).

MFC after: 2 weeks

7 years agoSupport for linux ext2fs posix-draft ACLs.
Pedro F. Giffuni [Sun, 28 May 2017 15:39:11 +0000 (15:39 +0000)]
Support for linux ext2fs posix-draft ACLs.

This is closely tied to the Extended Attribute implementation.

Submitted by: Fedor Uporov
Reviewed by: kevlo, pfg

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

7 years ago[etherswitch] [rtl8366] add phy4cpu setting and support mdioproxy
Michael Zhilin [Sun, 28 May 2017 12:14:33 +0000 (12:14 +0000)]
[etherswitch] [rtl8366] add phy4cpu setting and support mdioproxy

Tested on WZR-HP-G301NH(RTL8366RB) and WZR-HP-G300NH(RTL8366SR).

Submitted by:   Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10740

7 years ago[mips] [bhnd] Support of old PMU for BMIPS and siba SoC
Michael Zhilin [Sun, 28 May 2017 12:05:16 +0000 (12:05 +0000)]
[mips] [bhnd] Support of old PMU for BMIPS and siba SoC

 - Fix typo of PLL Type 4
 - Don't panic of frequency getters

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D10967

7 years agoUpdate getdirentries(2) page for new struct dirent layout.
Konstantin Belousov [Sun, 28 May 2017 09:29:53 +0000 (09:29 +0000)]
Update getdirentries(2) page for new struct dirent layout.

Sponsored by: The FreeBSD Foundation

7 years agoSend all of `data`, not just a portion of it
Enji Cooper [Sun, 28 May 2017 09:21:28 +0000 (09:21 +0000)]
Send all of `data`, not just a portion of it

It was sending only a long's worth (4 or 8 bytes) of data previously
(instead of the entire buffer) via send(2).

MFC after: 1 week
Reported by: Coverity
CID: 1229966122996712300041230005
Sponsored by: Dell EMC Isilon

7 years agoInitial `srv` before using it in bind(2)
Enji Cooper [Sun, 28 May 2017 09:08:30 +0000 (09:08 +0000)]
Initial `srv` before using it in bind(2)

MFC after: 3 days
Reported by: Coverity
CID: 1357526
Sponsored by: Dell EMC Isilon

7 years agoDon't leak accept_fd on thread completion
Enji Cooper [Sun, 28 May 2017 09:01:58 +0000 (09:01 +0000)]
Don't leak accept_fd on thread completion

MFC after: 3 days
Reported by: Coverity
CID: 1296068
Sponsored by: Dell EMC Isilon

7 years agoUse main(void) instead of main(argc __unused, argv __unused)
Enji Cooper [Sun, 28 May 2017 08:57:08 +0000 (08:57 +0000)]
Use main(void) instead of main(argc __unused, argv __unused)

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoUse an exit code of 1 instead of -1 for reasons noted in r319056
Enji Cooper [Sun, 28 May 2017 08:55:32 +0000 (08:55 +0000)]
Use an exit code of 1 instead of -1 for reasons noted in r319056

MFC after: 3 days
Sponsored by: Dell EMC Isilon