Commit Graph

231125 Commits

Author SHA1 Message Date
Ed Maste
d8ba45e213 Revert r313780 (UFS_ prefix) 2018-03-17 12:59:55 +00:00
Edward Tomasz Napierala
7651c3af83 Fix formatting errors that resulted in apropos(1) output looking weird.
MFC after:	2 weeks
2018-03-17 11:41:06 +00:00
Ed Maste
1e2b9afca9 Prefix UFS symbols with UFS_ to reduce namespace pollution
Followup to r313780.  Also prefix ext2's and nandfs's versions with
EXT2_ and NANDFS_.

Reported by:	kib
Reviewed by:	kib, mckusick
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9623
2018-03-17 01:48:27 +00:00
Ed Maste
4e78ff7068 ANSIfy sys/x86 2018-03-17 01:40:09 +00:00
Conrad Meyer
48fc14c0aa elftoolchain nm(1): Initialize allocated memory before use
In out of memory scenarios (where one of these allocations failed but
other(s) did not), nm(1) could reference the uninitialized value of these
allocations (undefined behavior).

Always initialize any successful allocations as the most expedient
resolution of the issue.  However, I would encourage upstream elftoolchain
contributors to clean up the error path to just abort immediately, rather
than proceeding sloppily when one allocation fails.

Reported by:	Coverity
Sponsored by:	Dell EMC Isilon
2018-03-16 22:25:33 +00:00
Brooks Davis
28e7752907 Add _IOC_NEWLEN() and _IOC_NEWTYPE() macros.
These macros take an existing ioctl(2) command and replace the length
with the specified length or length of the specified type respectively.
These can be used to define commands for 32-bit compatibility with fewer
opportunities for cut-and-paste errors then a whole new definition.

Reviewed by:	cem, kib
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14706
2018-03-16 22:23:04 +00:00
Conrad Meyer
a8c03de86d libdtrace: Fix another uninitialized dtt_flags UB
Like r331073, eliminate a UB by fully initializing the struct with a designated
initializer.  Note that the similar src_dtt is not fully used, so a similar
treatment was not absolutely required.  I chose to leave it alone.  It
wouldn't hurt to do the same thing, though.

Reported by:	Coverity
Sponsored by:	Dell EMC Isilon
2018-03-16 21:10:36 +00:00
Devin Teske
3485f3b359 Add myself to committers-ports.dot
Reviewed by:	imp
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D14688
2018-03-16 21:03:54 +00:00
Conrad Meyer
2c710c67d4 telnetd(8): Fix dereference of uninitialized value 'IF'
Reported by:	Coverity
Sponsored by:	Dell EMC Isilon
2018-03-16 20:59:56 +00:00
Conrad Meyer
1ad2da031e libdtrace: Eliminate a minor UB by fully initializing parameter struct
The dtt_flags value is dereferenced by dt_type_pointer() and must be
initialized first.

Reported by:	Coverity
Sponsored by:	Dell EMC Isilon
2018-03-16 20:43:40 +00:00
Conrad Meyer
db488e4f52 random(4): Poll for signals during large reads
Occasionally poll for signals during large reads of the /dev/u?random
devices.  This allows cancellation via SIGINT of accidental invocations of
very large reads.  (A 2GB /dev/random read, which takes about 10 seconds on
my 2017 AMD Zen processor, can be aborted.)

I believe this behavior was intended since 2014 (r273997), just not fully
implemented.

This is motivated by a potential getrandom(2) interface that may not
explicitly forbid extremely large reads on 64-bit platforms -- even larger
than the 2GB limit imposed on devfs I/O by default.  Such reads, if they are
to be allowed, should be cancellable by the user or administrator.

Reviewed by:	delphij
Approved by:	secteam (delphij)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D14684
2018-03-16 18:50:26 +00:00
Warner Losh
3fcd5d6e92 Make not getting BootOrder a warning, not a fatal error when printing.
Sponsored by: Netflix
2018-03-16 18:16:31 +00:00
Ian Lepore
9c45f7b4fd Use EFI RTC capabilities info when registering, add bootverbose diagnostics.
Make some small improvements to the efirtc driver by obtaining the clock
capabilities (resolution and whether the sub-second counters are reset) and
using the info when registering the clock. When the hardware zeroes out the
subsecond info on clock-set, schedule clock updates to happen just before
top-of-second, so that the RTC time is closely in-sync with kernel time.

Also, in the identify() routine, always add the driver if EFI runtime
services are available, then decide in probe() whether to attach the driver
or not. If not attaching and bootverbose is on, say why. All of this is
basically to avoid "silent failure" -- if someone thinks there should be an
efi rtc and it's not attaching, at least they can set bootverbose and maybe
get a clue from the output.

Differential Revision:	https://reviews.freebsd.org/D14565 (timed out)
2018-03-16 18:16:27 +00:00
Warner Losh
1ce0264e67 Only print boot order / boot current if we can get the variables from
the loader. Some UEFI implementations don't return all of them.

Sponsored by: Netflix
2018-03-16 18:12:50 +00:00
Dimitry Andric
bf22ec69ef Pull in r321999 from upstream clang trunk (by Ivan A. Kosarev):
[CodeGen] Fix TBAA info for accesses to members of base classes

  Resolves:
  Bug 35724 - regression (r315984): fatal error: error in backend:
  Broken function found (Did not see access type in access path!)
  https://bugs.llvm.org/show_bug.cgi?id=35724

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

This fixes "Did not see access type in access path" fatal errors when
building the devel/gdb port (version 8.1).

Reported by:	jbeich
PR:		226658
MFC after:	3 months
X-MFC-With:	r327952
2018-03-16 18:04:13 +00:00
Dimitry Andric
077d36ae02 Pull in r327638 from upstream llvm trunk (by Matthew Simpson):
[ConstantFolding, InstSimplify] Handle more vector GEPs

  This patch addresses some additional cases where the compiler crashes
  upon encountering vector GEPs. This should fix PR36116.

  Differential Revision: https://reviews.llvm.org/D44219
  Reference: https://bugs.llvm.org/show_bug.cgi?id=36116

This fixes an assertion when building the emulators/snes9x port.

Reported by:	jbeich
PR:		225471
MFC after:	3 months
X-MFC-With:	r327952
2018-03-16 17:50:44 +00:00
Kirill Ponomarev
29c29cbb40 Extend SSID maximum string length to 32 chars to support longer SSID
names.

Approved by:	adrian
Differential Revision:	https://reviews.freebsd.org/D14710
2018-03-16 16:56:56 +00:00
Ian Lepore
9c237f3a13 Add the header file needed for the recently-added call to pagedaemon_wakeup(). 2018-03-16 16:06:25 +00:00
Michael Tuexen
1574b1e41e Set the inp_vflag consistently for accepted TCP/IPv6 connections when
net.inet6.ip6.v6only=0.

Without this patch, the inp_vflag would have INP_IPV4 and the
INP_IPV6 flags for accepted TCP/IPv6 connections if the sysctl
variable net.inet6.ip6.v6only is 0. This resulted in netstat
to report the source and destination addresses as IPv4 addresses,
even they are IPv6 addresses.

PR:			226421
Reviewed by:		bz, hiren, kib
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D13514
2018-03-16 15:26:07 +00:00
Ed Maste
06d4810126 Chase r331057 in libsysdecode erno table 2018-03-16 15:15:25 +00:00
Ed Maste
d595c5c0d6 linux_errno.c: add newer errno values
Also introduce a static assert to ensure the list is kept up to date.

Sponsored by:	Turing Robotic Industries Inc.
2018-03-16 14:51:47 +00:00
Ed Maste
6e481f83f7 Share a single bsd-linux errno table across MD consumers
Three copies of the linuxulator linux_sysvec.c contained identical
BSD to Linux errno translation tables, and future work to support other
architectures will also use the same table.  Move the table to a common
file to be used by all.  Make it 'const int' to place it in .rodata.

(Some existing Linux architectures use MD errno values, but x86 and Arm
share the generic set.)

This change should introduce no functional change; a followup will add
missing errno values.

MFC after:	3 weeks
Sponsored by:	Turing Robotic Industries Inc.
Differential Revision:	https://reviews.freebsd.org/D14665
2018-03-16 14:46:38 +00:00
Ed Maste
1d071ce340 Move assym.s to DPSRC in sgx module
assym.s is only to be included by other .s files, and should not
actually be assembled by itself.
2018-03-16 13:33:42 +00:00
Ed Maste
dd851c507b ANSIfy i386/vm86.c 2018-03-16 12:12:41 +00:00
Conrad Meyer
27cb8d849f Garbage collect unused chacha20 code
Two copies of chacha20 were imported into the tree on Apr 15 2017 (r316982)
and Apr 16 2017 (r317015).  Only the latter is actually used by anything, so
just go ahead and garbage collect the unused version while it's still only
in CURRENT.

I'm not making any judgement on which implementation is better.  If I pulled
the wrong one, feel free to swap the existing implementation out and replace
it with the other code (conforming to the API that actually gets used in
randomdev, of course).  We only need one generic implementation.

Sponsored by:	Dell EMC Isilon
2018-03-16 07:11:53 +00:00
Conrad Meyer
5d3b36666b Fix GCC build: Remove redundant pagedaemon_wakeup declaration
Introduced in r331018.

Reported by:	kevans
Sponsored by:	Dell EMC Isilon
2018-03-16 07:05:09 +00:00
Warner Losh
d85d964829 Try polling the qpairs on timeout.
On some systems, we're getting timeouts when we use multiple queues on
drives that work perfectly well on other systems. On a hunch, Jim
Harris suggested I poll the completion queue when we get a timeout.
This patch polls the completion queue if no fatal status was
indicated. If it had pending I/O, we complete that request and
return. Otherwise, if aborts are enabled and no fatal status, we abort
the command and return. Otherwise we reset the card.

This may clear up the problem, or we may see it result in lots of
timeouts and a performance problem. Either way, we'll know the next
step. We may also need to pay attention to the fatal status bit
of the controller.

PR: 211713
Suggested by: Jim Harris
Sponsored by: Netflix
2018-03-16 05:23:48 +00:00
Ian Lepore
3a25d855de Add required interface header.
Reported by:	andreast@
2018-03-16 02:46:08 +00:00
Andriy Voskoboinyk
5f792f7478 rtwn(4): de-hardcode ('h/w rate index' - 'corresponding MCS index') constant 2018-03-16 01:03:10 +00:00
Andriy Voskoboinyk
46e18fc6d4 urtw(4), zyd(4): reduce code verbosity.
No functional change intended.
2018-03-16 00:38:10 +00:00
Andriy Voskoboinyk
2757acf673 urtw(4): provide names for some commonly used rate indices + drop
now-unused urtw_rate2rtl()
2018-03-16 00:09:16 +00:00
Andriy Voskoboinyk
2a440d19c1 Correct comment for IFM_IEEE80211_VHT media variant. 2018-03-15 23:32:29 +00:00
Brooks Davis
064c9c3d42 Add a request structure and make the implementation use it.
This allows compatibility translation to take place on the stack
(md_ioctl is too big) and is more suitable as a public interface within
the kernel than the kern_ioctl interface.

Except for the initialization of the md_req from the md_ioctl
(including detection of kernel md_file pointers) and the updating
of the md_ioctl prior to return, this is a mechanical replacment
of md_ioctl and mdio with md_req and mdr.

Reviewed by:	markj, cem, kib (assorted versions)
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14704
2018-03-15 21:42:49 +00:00
Brooks Davis
6f2e9930be Finish removal of dataacq.h (r330716) and pcaudioio.h (r330766). 2018-03-15 21:31:19 +00:00
Jeff Roberson
30fbfdda6c Eliminate pageout wakeup races. Take another step towards lockless
vmd_free_count manipulation.  Reduce the scope of the free lock by
using a pageout lock to synchronize sleep and wakeup.  Only trigger
the pageout daemon on transitions between states.  Drive all wakeup
operations directly as side-effects from freeing memory rather than
requiring an additional function call.

Reviewed by:	markj, kib
Tested by:	pho
Sponsored by:	Netflix, Dell/EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D14612
2018-03-15 19:23:07 +00:00
Mark Johnston
d09fcbd30e Add a space between a section number and a following comma.
Fix some nits from igor while here.

MFC after:	3 days
2018-03-15 19:03:54 +00:00
David Bright
cc732b9da5 Modify rc.d/fsck to handle new status from fsck/fsck_ffs
r328013 introduced a new error code from fsck_ffs that indicates that
it could not completely fix the file system; this happens when it
prints the message PLEASE RERUN FSCK. However, this status can happen
when fsck is run in "preen" mode and the rc.d/fsck script does not
handle that error code. Modify rc.d/fsck so that if "fsck -p"
("preen") returns the new status code (16) it will run "fsck -y", as
it currently does for a status code of 8 (the "standard error exit").

Reported by:	markj
Reviewed by:	mckusick, markj, ian, rgrimes
MFC after:	3 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D14679
2018-03-15 18:29:56 +00:00
Brooks Davis
b65794ad84 Move implementation of ioctls into kern_*() functions.
Move locks from outside ioctl to the individual implementations.

This is the first step of changing the implementations to act on a
kernel-internal request struct rather than on struct md_ioctl and to
removing the use of kern_ioctl in mountroot.

Reviewed by:	cem, kib, markj (prior version)
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14700
2018-03-15 18:12:55 +00:00
Edward Tomasz Napierala
6616539dcc Fix iSCSI target crash on session reinstation.
The crash scenario goes like this: there's a thread waiting on "reinstate";
because it doesn't update the timeout counter it gets terminated by the
callout; at this point the maintenance thread starts the termination routine.
The first thread finishes waiting, proceeds to icl_conn_handoff(), and drops
the refcount, which allows the maintenance thread to free its resources.  At
this point another thread receives a PDU.  Boom.

PR:		222898, 219866
Reported by:	Eugene M. Zheganin <emz at norma.perm.ru>
Tested by:	Eugene M. Zheganin <emz at norma.perm.ru>
Reviewed by:	mav@ (earlier version)
MFC after:	2 weeks
Sponsored by:	playkey.net
2018-03-15 17:36:13 +00:00
Brooks Davis
94598ac9f9 Restore the behavior of returning the total number of units by
unconditionally incrementing i in the loop;

Reported by:	cem
MFC with:	r330880
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14685
2018-03-15 16:37:43 +00:00
Conrad Meyer
8475a4175f aesni(4): Stylistic/comment enhancements
Improve clarity of a comment and style(9) some areas.

No functional change.

Reported by:	markj (on review of a mostly-copied driver)
Sponsored by:	Dell EMC Isilon
2018-03-15 16:17:02 +00:00
Baptiste Daroussin
8bf523086d Add termcap entries for the st terminal (https://st.sucksless.org)
MFC after:	3 days
2018-03-15 15:13:17 +00:00
Baptiste Daroussin
ce037f1b21 Fix tab vs space indentation
MFC after:	3 days
2018-03-15 15:05:26 +00:00
Andriy Gapon
bd539a8e3c zfs test suite: move definition of DISK to the cfg file in zpool_get
The variable is used not only by the setup script but also by the
atf test bodies.

Another one that should have been in r331001.
2018-03-15 14:47:53 +00:00
Andriy Gapon
0577c05e9a zfs test suite: add new pool properties / features to the zpool_get list 2018-03-15 14:41:09 +00:00
Andriy Gapon
1524d42a3e zfs test suite: move definition of DISK to the cfg file in zpool_get
The variable is used not only by the setup script but also by the
atf test bodies.

This should have been in r331001.
2018-03-15 14:35:46 +00:00
Andriy Gapon
4da82917ea zfs test suite: move definition of DISK to the cfg file in zpool_export
The variable is used not only by the setup script but also by the
atf test bodies.
2018-03-15 14:23:31 +00:00
Hiroki Sato
20d96999a4 Make getnameinfo(3) salen requirement less strict and
document details of salen in getnameinfo(3) manual page.

getnameinfo(3) returned EAI_FAIL when salen was not equal to
the length corresponding to the value specified by sa->sa_family.
However, POSIX or RFC 3493 does not require it and RFC 4038
Sec.6.2.3 shows an example passing sizeof(struct sockaddr_storage)
to salen.

This change makes the requirement less strict by accepting
salen up to sizeof(struct sockaddr_storage).  It also includes
two more changes: one is to fix return values because both SUSv4
and RFC 3493 require EAI_FAMILY when the address length is invalid,
another is to fix sa_len dependency in PF_LOCAL.

Pointed out by:	Christophe Beauval
Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D14585
2018-03-15 13:46:28 +00:00
Andriy Gapon
a7478ad1ce zfs test suite: support device paths with intermediate directories
The code assumed that disks (devices) used for testing are always named
like /dev/foo, but there is no reason for that restriction and we can
easily support paths like /dev/stripe/bar.
2018-03-15 12:47:34 +00:00
Andriy Gapon
aaaf06cd0c zfs test suite: fix a typo, TESTPOOL vs TESTPOOL2 2018-03-15 12:44:13 +00:00