]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoamd64: __exclusive_cache_line pv_chunks_mutex and pv_list_locks
mjg [Fri, 20 Oct 2017 03:38:58 +0000 (03:38 +0000)]
amd64: __exclusive_cache_line pv_chunks_mutex and pv_list_locks

Note that pv_list_locks is an array and currently it fits 2 locks per line.
Resizing it and/or putting more locks in different lines requires several tests.

MFC after: 1 week

6 years agorwlock: reduce lockstat branches in the slowpath
mjg [Fri, 20 Oct 2017 03:32:42 +0000 (03:32 +0000)]
rwlock: reduce lockstat branches in the slowpath

MFC after: 1 week

6 years agoExpand the TLB nest level mask to 3 bits to match the 32-bit mask
jhibbits [Fri, 20 Oct 2017 03:31:23 +0000 (03:31 +0000)]
Expand the TLB nest level mask to 3 bits to match the 32-bit mask

This really doesn't change anything right now, because BOOKE_TLB_MAXNEST is only
3, which fits into the 2 bits currently used.

6 years agoamd64: avoid acquiring dt lock if possible (which is the common case)
mjg [Fri, 20 Oct 2017 03:30:02 +0000 (03:30 +0000)]
amd64: avoid acquiring dt lock if possible (which is the common case)

Discussed with: kib
MFC after: 1 week

6 years agoNo need to check for AIM here
jhibbits [Fri, 20 Oct 2017 03:13:31 +0000 (03:13 +0000)]
No need to check for AIM here

This block is already in a #ifdef AIM block.

6 years agoBook-E debug trace fixes
jhibbits [Fri, 20 Oct 2017 03:03:04 +0000 (03:03 +0000)]
Book-E debug trace fixes

* Book-E can have Altivec exceptions, so move it out of the AIM-only block.
* Print the right DSI trap mode (read vs write) for Book-E

While here, fix some whitespace found while reviewing other diffs.

6 years agomtx: stop testing SCHEDULER_STOPPED in kabi funcs for spin mutexes
mjg [Fri, 20 Oct 2017 00:34:25 +0000 (00:34 +0000)]
mtx: stop testing SCHEDULER_STOPPED in kabi funcs for spin mutexes

There is nothing panic-breaking to do in the unlock case and the lock
case will fallback to the slow path doing the check already.

MFC after: 1 week

6 years agomtx: clean up locking spin mutexes
mjg [Fri, 20 Oct 2017 00:30:35 +0000 (00:30 +0000)]
mtx: clean up locking spin mutexes

1) shorten the fast path by pushing the lockstat probe to the slow path
2) test for kernel panic only after it turns out we will have to spin,
in particular test only after we know we are not recursing

MFC after: 1 week

6 years agoCorrect an inverted conditional for determining the multiplier of
marius [Thu, 19 Oct 2017 21:57:14 +0000 (21:57 +0000)]
Correct an inverted conditional for determining the multiplier of
the user data area size.

6 years agoAllwinner: Fix compilation
manu [Thu, 19 Oct 2017 21:34:53 +0000 (21:34 +0000)]
Allwinner: Fix compilation

Forgot an #endif in r324773, sorry for the breakage.

6 years agopsm(4): Add sanity checks to Synaptics touchpad driver resolution parser.
wulf [Thu, 19 Oct 2017 21:07:28 +0000 (21:07 +0000)]
psm(4): Add sanity checks to Synaptics touchpad driver resolution parser.

This fixes "Kernel has only x or y resolution, not both" libinput error.

Reported by: Ivan <bsd@abinet.ru>
Tested by: Ivan <bsd@abinet.ru>
Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoAllwinner: Add EARLY_PRINTF function
manu [Thu, 19 Oct 2017 20:56:30 +0000 (20:56 +0000)]
Allwinner: Add EARLY_PRINTF function

EARLY_PRINTF can help debugging early problems.
Add it for Allwinner SoCs.

Tested On: OrangePi One (H3)

6 years agoums(4): Unreverse evdev Tilt-axis reporting to match Linux.
wulf [Thu, 19 Oct 2017 20:54:55 +0000 (20:54 +0000)]
ums(4): Unreverse evdev Tilt-axis reporting to match Linux.

sysmouse tilt to button mapping remained unchanged.

Reviewed by: hselasky
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12671

6 years agotegra: Do not define early printf function
manu [Thu, 19 Oct 2017 20:52:17 +0000 (20:52 +0000)]
tegra: Do not define early printf function

Since tegra is now in GENERIC, do not enable the early printf
function as it can conflict with others.

6 years agobthidd: Fix leds on multireport keyboards broken after r297217
wulf [Thu, 19 Oct 2017 20:42:46 +0000 (20:42 +0000)]
bthidd: Fix leds on multireport keyboards broken after r297217

Reviewed by: emax, gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12214

6 years agoHide struct sockbuf from userland.
glebius [Thu, 19 Oct 2017 18:04:16 +0000 (18:04 +0000)]
Hide struct sockbuf from userland.

PR: 222917 (exp-run)

6 years agoFix unused variable + style(9) fixes inside the ext4_ext_find_extent()
fsu [Thu, 19 Oct 2017 16:42:03 +0000 (16:42 +0000)]
Fix unused variable + style(9) fixes inside the ext4_ext_find_extent()

Approved by:    pfg (mentor)
Reported by:    Coverity
CID:            1381754
MFC after:      6 months

6 years agopsci: change bootverbose string to 'PSCI 0.2 compatible'
emaste [Thu, 19 Oct 2017 16:40:17 +0000 (16:40 +0000)]
psci: change bootverbose string to 'PSCI 0.2 compatible'

Prior to r324754 we treated PSCI 0.2 and 1.0 as identical, and r324754
extended that to include all PSCI 1.x revisions. Change the string
emitted under bootverbose to reference '0.2 compatible' to avoid
confusion when the system includes a later PSCI rev.

Discussed with: andrew
Sponsored by: The FreeBSD Foundation

6 years agoremove spa_sync_on assert from spa_async_thread_vd
avg [Thu, 19 Oct 2017 16:36:07 +0000 (16:36 +0000)]
remove spa_sync_on assert from spa_async_thread_vd

Unlike spa_async_thread that can get started only from spa_sync()
spa_async_thread_vd can get started from other contexts.
Additionally, spa_async_thread_vd does not really depend on
spa sync being enabled.

The incorrect assert could be triggered by importing a pool in the
read-only mode and then disconnecting one of its disks.
In this case spa_sync_on was false because the pool was read-only
and spa_async_thread_vd was started to handle SPA_ASYNC_REMOVE event.

Note: spa_async_thread_vd() currently exists only in FreeBSD, it was
split out of spa_async_thread() in r253990.

Discussed with: mav
MFC after: 2 weeks

6 years agoAllow later PSCI revisions to also work. The latest ARM Trusted Firmware
andrew [Thu, 19 Oct 2017 13:22:52 +0000 (13:22 +0000)]
Allow later PSCI revisions to also work. The latest ARM Trusted Firmware
reports version 1.1 so the check was failing. As thjis is a minor change
from 1.0, and future 1.x revisions are also expected to be backwards
compatible just ignore the minor revision in the init handler.

Sponsored by: DARPA, AFRL

6 years agomsdosfs: fix build with MSDOSFS_DEBUG
emaste [Thu, 19 Oct 2017 12:55:11 +0000 (12:55 +0000)]
msdosfs: fix build with MSDOSFS_DEBUG

Inspired by a patch submission by longwitz@incore.de with many changes
for ino64 in HEAD.

PR: 199152
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoRelax per-ifnet cif_vrs list double locking in carp(4).
mav [Thu, 19 Oct 2017 09:01:15 +0000 (09:01 +0000)]
Relax per-ifnet cif_vrs list double locking in carp(4).

In all cases where cif_vrs list is modified, two locks are held: per-ifnet
CIF_LOCK and global carp_sx.  It means to read that list only one of them
is enough to be held, so we can skip CIF_LOCK when we already have carp_sx.

This fixes kernel panic, caused by attempts of copyout() to sleep while
holding non-sleepable CIF_LOCK mutex.

Discussed with: glebius
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

6 years agoBatch atomic updates to the number of active, inactive, and laundry
alc [Thu, 19 Oct 2017 04:13:47 +0000 (04:13 +0000)]
Batch atomic updates to the number of active, inactive, and laundry
pages by vm_object_terminate_pages().  For example, for a "buildworld"
workload, this batching reduces vm_object_terminate_pages()'s average
execution time by 12%.  (The total savings were about 11.7 billion
processor cycles.)

Reviewed by: kib
MFC after: 1 week

6 years agoAdd some more devices to the MPC85XX-based configs
jhibbits [Thu, 19 Oct 2017 03:38:53 +0000 (03:38 +0000)]
Add some more devices to the MPC85XX-based configs

These devices bring the configs closer to a desktop-like (GENERIC) kernel
config.
* The Freescale DIU support was added to the config in r306358.
  Without keyboard support video support is nearly pointless, so add ukbd and
  ums.
* The AmigaOne X5000, and P1022 devboard, both use a variant of the ds1307 RTC
* cpufreq scaling is currently supported by the p1022.  More SoCs will be added
  eventually.

6 years agoAnticongestion refinements for ntpd rc script. This reverts r324681
cy [Thu, 19 Oct 2017 03:17:50 +0000 (03:17 +0000)]
Anticongestion refinements for ntpd rc script. This reverts r324681
and checks if ntp leapfile needs fetching before entering into the
anticongestion sleep.

Unfortunately some ports still use their own sleeps so, this commit
doesn't address the complete problem which is compounded by every
port that uses its own anticongestion mechanism.

Discussed with: asomers

6 years agoRemove some unnecessary includes
jhibbits [Thu, 19 Oct 2017 02:14:39 +0000 (02:14 +0000)]
Remove some unnecessary includes

6 years agosysctl: only take mem lock if oldlen is > 4 * PAGE_SIZE
mjg [Thu, 19 Oct 2017 01:38:31 +0000 (01:38 +0000)]
sysctl: only take mem lock if oldlen is > 4 * PAGE_SIZE

The previous limit of just one page is hit by ps.

The entire mechanism should be reworked, if not whacked. It seems the intent
is to reduce kernel dos-ability - some handlers wire the amount of memory
passed here. Handlers should probably stop wiring in the first place or in
the worst case indicate they are doing so so that the check is done only if
necessary. It should also probably be a counter, not a lock.

MFC after: 1 week

6 years agoexecve: avoid one proc lock/unlock trip unless PTRACE_EXEC is set
mjg [Thu, 19 Oct 2017 00:46:15 +0000 (00:46 +0000)]
execve: avoid one proc lock/unlock trip unless PTRACE_EXEC is set

MFC after: 1 week

6 years agoTidy up pmc support at execve.
mjg [Thu, 19 Oct 2017 00:38:14 +0000 (00:38 +0000)]
Tidy up pmc support at execve.

The proc-specific check is inherently racy, so the code can just unlock
beforehand.

MFC after: 1 week

6 years agosysvsem: check if semu_list has anything on it before grabbing the lock
mjg [Thu, 19 Oct 2017 00:31:00 +0000 (00:31 +0000)]
sysvsem: check if semu_list has anything on it before grabbing the lock

This should get a process-specific support instead.

MFC after: 1 week

6 years agoAdopt jail.8 to our brave new bsdinstall world
bjk [Wed, 18 Oct 2017 22:56:46 +0000 (22:56 +0000)]
Adopt jail.8 to our brave new bsdinstall world

Submitted by: Steve Kargl
MFC after: 3 days

6 years agoDon't take Giant for SMP status and cpu topology sysctls.
mjg [Wed, 18 Oct 2017 22:00:44 +0000 (22:00 +0000)]
Don't take Giant for SMP status and cpu topology sysctls.

Not only this lock doesn't play any role here, dirtying it slows down
other things a little bit as giant-held checks (e.g. DROP_GIANT) are
spread all over the kernel.

MFC after: 1 week

6 years agoFix a signed/unsigned warning.
tuexen [Wed, 18 Oct 2017 21:08:35 +0000 (21:08 +0000)]
Fix a signed/unsigned warning.

MFC after: 1 week

6 years agoAbort an SCTP association, when a DATA chunk is followed by an unknown
tuexen [Wed, 18 Oct 2017 20:17:44 +0000 (20:17 +0000)]
Abort an SCTP association, when a DATA chunk is followed by an unknown
chunk with a length smaller than the minimum length.

Thanks to Felix Weinrank for making me aware of the problem.
MFC after: 3 days

6 years agoql*_def.h: fix QL_ALIGN parenthesization
rlibby [Wed, 18 Oct 2017 19:28:28 +0000 (19:28 +0000)]
ql*_def.h: fix QL_ALIGN parenthesization

QL_ALIGN is a set of copies of roundup2, but it was missing an outer set
of parentheses, which began to matter with r324538. Now, fully copy the
parenthesization of roundup2.

Reviewed by: davidcs
Differential Revision: https://reviews.freebsd.org/D12673

6 years agoImport the latest CloudABI definitions, version 0.16.
ed [Wed, 18 Oct 2017 19:22:53 +0000 (19:22 +0000)]
Import the latest CloudABI definitions, version 0.16.

The most important change in this release is the removal of the
poll_fd() system call; CloudABI's equivalent of kevent(). Though I think
that kqueue is a lot saner than many of its alternatives, our
experience is that emulating this system call on other systems
accurately isn't easy. It has become a complex API, even though I'm not
convinced this complexity is needed. This is why we've decided to take a
different approach, by looking one layer up.

We're currently adding an event loop to CloudABI's C library that is API
compatible with libuv (except when incompatible with Capsicum).
Initially, this event loop will be built on top of plain inefficient
poll() calls. Only after this is finished, we'll work our way backwards
and design a new set of system calls to optimize it.

Interesting challenges will include integrating asynchronous I/O into
such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due
to it being unreliable and having undesired semantics.

Obtained from: https://github.com/NuxiNL/cloudabi

6 years agoRevert change which got in accidently.
tuexen [Wed, 18 Oct 2017 18:59:35 +0000 (18:59 +0000)]
Revert change which got in accidently.

6 years agoFix a bug introduced in r324638.
tuexen [Wed, 18 Oct 2017 18:56:56 +0000 (18:56 +0000)]
Fix a bug introduced in r324638.
Thanks to Felix Weinrank for making me aware of this.

MFC after: 3 days

6 years agoRemove CPU_HAVEFPU.
jhb [Wed, 18 Oct 2017 17:23:16 +0000 (17:23 +0000)]
Remove CPU_HAVEFPU.

Instead, use a runtime decision to handle COP1 traps.  If floating point
support is present in the current CPU, enable saving of the floating point
state.  If support is not present, fail with SIGILL.

Reviewed by: imp, br
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D12707

6 years agoTeach beinstall to use and prefer svnlite, with a fallback to svn.
brd [Wed, 18 Oct 2017 15:48:26 +0000 (15:48 +0000)]
Teach beinstall to use and prefer svnlite, with a fallback to svn.

Approved by: will

6 years agoMove kernel dump offset tracking into MI code.
markj [Wed, 18 Oct 2017 15:38:05 +0000 (15:38 +0000)]
Move kernel dump offset tracking into MI code.

All of the kernel dump implementations keep track of the current offset
("dumplo") within the dump device. However, except for textdumps, they
all write the dump sequentially, so we can reduce code duplication by
having the MI code keep track of the current offset. The new
dump_append() API can be used to write at the current offset.

This is needed to implement support for kernel dump compression in the
MI kernel dump code.

Also simplify dump_encrypted_write() somewhat: use dump_write() instead
of duplicating its bounds checks, and get rid of the redundant offset
tracking.

Reviewed by: cem
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11722

6 years agoAdd references to sysrc(8).
se [Wed, 18 Oct 2017 13:25:44 +0000 (13:25 +0000)]
Add references to sysrc(8).

Reported by: Kurt Jaeger (lists at opsec.eu)

6 years agolibsa/ip: stop read loop on bad fragments
tsoome [Wed, 18 Oct 2017 08:06:05 +0000 (08:06 +0000)]
libsa/ip: stop read loop on bad fragments

Lets try to clear out from case of overlapping etc fragments and stop read.

Reported by: Dan McDonald

6 years agolibsa/ip.c: misplaced comment, ip_v is half char, not ip_p
tsoome [Wed, 18 Oct 2017 07:39:21 +0000 (07:39 +0000)]
libsa/ip.c: misplaced comment, ip_v is half char, not ip_p

The comment should be at previous line.

Reported by: Dan McDonald

6 years agoDo not report reduction of swap zone if it was not.
kib [Wed, 18 Oct 2017 07:27:43 +0000 (07:27 +0000)]
Do not report reduction of swap zone if it was not.

After r324600 we see the actual reservation.

Reported by: jkim
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoext2: delete redundant decl of ext2_fserr
rlibby [Wed, 18 Oct 2017 00:41:23 +0000 (00:41 +0000)]
ext2: delete redundant decl of ext2_fserr

Fix gcc build after r324706.

Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D12709

6 years agoImprove computation of {BC,LL}OBJS.
jonathan [Wed, 18 Oct 2017 00:33:20 +0000 (00:33 +0000)]
Improve computation of {BC,LL}OBJS.

Now that OBJS has grown an OBJS_SRCS_FILTER variable, use this variable
in the computation of BCOBJS and LLOBJS too. Also move BCOBJS and LLOBJS
computation to be next to the OBJS computation: this should both make
the parallel structure clearer and serve to remind people changing OBJS
that parallel changes are required in BCOBJS and LLOBJS.

A side effect of this change is that BCOBJS and LLOBJS will be available
even when LLVM_LINK has not been defined, but that seems like a positive
change: there's no reason we can't ask "what bitcode files would you
generate" just because we can't link those files together into a
complete bitcode representation of a binary or library.

Reviewed by: sjg
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12701

6 years agoImprove logic of CLEANFILES+=${PROG_FULL}.{bc,ll}.
jonathan [Wed, 18 Oct 2017 00:30:15 +0000 (00:30 +0000)]
Improve logic of CLEANFILES+=${PROG_FULL}.{bc,ll}.

The build rule describing how to create ${PROG_FULL}.{bc,ll} is only
dependent on LLVM_LINK being defined, not on MK_DEBUG_FILES being "yes".
Move the addition of ${PROG_FULL}.{bc,ll} out of the conditional block
under `.if ${MK_DEBUG_FILES} != "no"` and up next to where the build
rules for ${PROG_FULL}.{bc,ll} are defined.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12703

6 years agoRemove mbpool(9) now that it has no consumers.
brooks [Wed, 18 Oct 2017 00:18:03 +0000 (00:18 +0000)]
Remove mbpool(9) now that it has no consumers.

mbpool existed to support NICs with memory interfaces and all remaining
comsumers were removed earlier this year with NATM.

Reviewed by: jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10513

6 years agoRevert "Unify boot1 with loader" change r324646
imp [Tue, 17 Oct 2017 23:38:27 +0000 (23:38 +0000)]
Revert "Unify boot1 with loader" change r324646

Back out the unification commit to boot1. There's some issues on the
arm and arm64 platforms that need to be addressed with code
changes. There's also a discussion on arch@ about the future of
boot1.efi vs just using loader.efi that needs to play out. So take a
pause on these changes until the arm issues can be fixed and it's
clear boot1.efi will survive into FreeBSD 12.

OK'd by: Eric@meatspace

6 years agoembed_mfs: add error handling, usage
emaste [Tue, 17 Oct 2017 21:13:26 +0000 (21:13 +0000)]
embed_mfs: add error handling, usage

Ensure that we are called with two arguments, and that the output file
is writable. Also, if we cannot find the mfs section report the output
file name rather than "kernel", as this script may be used with other
than kernels.

Sponsored by: The FreeBSD Foundation

6 years agoAdd inital extents read-write support.
fsu [Tue, 17 Oct 2017 20:45:44 +0000 (20:45 +0000)]
Add inital extents read-write support.

Approved by:    pfg (mentor)
MFC after:      6 months
RelNotes:       Yes

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

6 years agocxgbe: delete now-redundant vnet decls
rlibby [Tue, 17 Oct 2017 20:37:31 +0000 (20:37 +0000)]
cxgbe: delete now-redundant vnet decls

r324539 gathered some vnet decls into netinet/tcp_var.h, so that they
are now redundant in dev/cxgbe/tom/{t4_cpl_io.c,t4_ddp.c}. This triggers
gcc -Wredundant-decls.

Reviewed by: np
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12674

6 years agoFix a racy VI_DOOMED check in MNT_VNODE_FOREACH_ALL().
markj [Tue, 17 Oct 2017 19:41:45 +0000 (19:41 +0000)]
Fix a racy VI_DOOMED check in MNT_VNODE_FOREACH_ALL().

MNT_VNODE_FOREACH_ALL() is supposed to avoid returning doomed vnodes,
but the VI_DOOMED check it used was done without the vnode interlock
held, so it could race with a concurrent vgone().

Submitted by: Don Morris <don.morris@isilon.com>
Reviewed by: kib, mckusick
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12704

6 years agoloader.mk: clean md.o even if MD_IMAGE_SIZE not defined
emaste [Tue, 17 Oct 2017 19:11:29 +0000 (19:11 +0000)]
loader.mk: clean md.o even if MD_IMAGE_SIZE not defined

We don't normally provide special handling for optionally-included src
files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}.
Previously if one built with MD_IMAGE_SIZE, executed "make clean", and
then built with a different MD_IMAGE_SIZE md.o would not be rebuilt.

Reported by: Zakary Nafziger
Sponsored by: The FreeBSD Foundation

6 years agoWe need to include disk.o in libuboot.a when we're building with
imp [Tue, 17 Oct 2017 19:11:19 +0000 (19:11 +0000)]
We need to include disk.o in libuboot.a when we're building with
support for disk access.

Sponsored by: Netflix

6 years agoAdd a test for r324671 along with some other masked tests.
bdrewery [Tue, 17 Oct 2017 19:01:01 +0000 (19:01 +0000)]
Add a test for r324671 along with some other masked tests.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoloader: initialize dv_cleanup in md.c to eliminate clang warning
emaste [Tue, 17 Oct 2017 18:00:01 +0000 (18:00 +0000)]
loader: initialize dv_cleanup in md.c to eliminate clang warning

Submitted by: Zakary Nafziger <worldofzak@gmail.com>
Sponsored by: The FreeBSD Foundation

6 years agoUpdate wpa_supplicant/hostapd for 2017-01 vulnerability release.
gordon [Tue, 17 Oct 2017 17:22:36 +0000 (17:22 +0000)]
Update wpa_supplicant/hostapd for 2017-01 vulnerability release.

hostapd: Avoid key reinstallation in FT handshake
Prevent reinstallation of an already in-use group key
Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases
Fix TK configuration to the driver in EAPOL-Key 3/4 retry case
Prevent installation of an all-zero TK
Fix PTK rekeying to generate a new ANonce
TDLS: Reject TPK-TK reconfiguration
WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used
WNM: Ignore WNM-Sleep Mode Response without pending request
FT: Do not allow multiple Reassociation Response frames
TDLS: Ignore incoming TDLS Setup Response retries

Submitted by: jhb
Obtained from: https://w1.fi/security/2017-01/ (against later version)
Security: FreeBSD-SA-17:07
Security: CERT VU#228519
Security: CVE-2017-13077
Security: CVE-2017-13078
Security: CVE-2017-13079
Security: CVE-2017-13080
Security: CVE-2017-13081
Security: CVE-2017-13082
Security: CVE-2017-13086
Security: CVE-2017-13087
Security: CVE-2017-13088
Differential Revision: https://reviews.freebsd.org/D12693

6 years agoAdd LLVM IR libraries to CLEANFILES.
jonathan [Tue, 17 Oct 2017 16:29:50 +0000 (16:29 +0000)]
Add LLVM IR libraries to CLEANFILES.

We previously taught the build system how to create files like libfoo.bc,
but neglected to teach it about cleaning such files up. Rectify this now.

MFC after: 1 week
Sponsored by: DARPA, AFRL

6 years agonever retry oustanding requests when terminating iscsi session
avg [Tue, 17 Oct 2017 16:03:59 +0000 (16:03 +0000)]
never retry oustanding requests when terminating iscsi session

CAM_REQ_ABORTED sounds natural for aborting outstanding requests when
tearing down a session, but that status actually causes eligible
requests to be tried again.  That's completely useless, so let's use
CAM_DEV_NOT_THERE instead.  Perhaps there is a better status, but this
should be good enough.  The change should affect only the session
termination.

Tested by: Ben RUBSON <ben.rubson@gmail.com>
Reviewed by: mav, trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12653

6 years agoiscsi: do not hold the global lock while tearing down a session
avg [Tue, 17 Oct 2017 15:39:38 +0000 (15:39 +0000)]
iscsi: do not hold the global lock while tearing down a session

It should be sufficient to hold the lock just for removing the session
from the session list.  Everything else should be covered by the session
specific lock.

On top of that, at present we can get a deadlock caused by waiting on
the CAM SIM reference count while holding the global lock.  A specific
scenario involving ZFS is this:
- concurrent termination of two sessions, S1 and S2
- session S1 completed all I/Os and sleeps in CAM waiting for device
  close by ZFS;
- session S2 is also dead now, but can not forcefully complete
  outstanding requests by calling iscsi_session_cleanup() from
  iscsi_maintenance_thread_terminate(), since it can't get the same
  global sc_lock;
- as soon as there are unfinished requests, ZFS can not do
  spa_config_enter() as writer, and so can not close the device for
  session S1;
- deadlock.

Reported by: Ben RUBSON <ben.rubson@gmail.com>
Tested by: Ben RUBSON <ben.rubson@gmail.com>
Reviewed by: mav, trasz
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12652

6 years agoDragonFly 5.0.0 release added.
maxim [Tue, 17 Oct 2017 14:37:12 +0000 (14:37 +0000)]
DragonFly 5.0.0 release added.

6 years agoRemove lib/libstand again, accidentally readded in r324683
emaste [Tue, 17 Oct 2017 02:53:42 +0000 (02:53 +0000)]
Remove lib/libstand again, accidentally readded in r324683

6 years agowrite.2: correct maximum nbytes size for EINVAL error
emaste [Tue, 17 Oct 2017 02:51:45 +0000 (02:51 +0000)]
write.2: correct maximum nbytes size for EINVAL error

In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the
maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to
document this, and mention the sysctl that can be set to obtain the
previous behaviour.

PR: 196666
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoStyle. Replace 8 spaces with a tab.
cy [Tue, 17 Oct 2017 01:15:55 +0000 (01:15 +0000)]
Style. Replace 8 spaces with a tab.

MFC after: 2 weeks (with prior commit to this file)

6 years agoProvide an option to run the anticongestion ntpd leapfile fetch in
cy [Tue, 17 Oct 2017 01:15:13 +0000 (01:15 +0000)]
Provide an option to run the anticongestion ntpd leapfile fetch in
the background.

Original patch submitted by feld@. I added the "optional" bit.

Submitted by: feld (original patch)
MFC after: 2 weeks

6 years agogdb kernel server: fixup Search:memory style
rlibby [Tue, 17 Oct 2017 01:12:17 +0000 (01:12 +0000)]
gdb kernel server: fixup Search:memory style

This is a NFC patch to move around the Search:memory implementation so
that it doesn't exceed the standard column width and doesn't take so
much vertical space in gdb_trap.

Submitted by: Daniel O'Connor <darius@dons.net.au>
Reviewed by: cem, jhb
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12684

6 years agoUse taskqueue(9) to do writes/commits to mirrored DSs concurrently.
rmacklem [Mon, 16 Oct 2017 23:28:12 +0000 (23:28 +0000)]
Use taskqueue(9) to do writes/commits to mirrored DSs concurrently.

When the NFSv4.1 pNFS client is using a Flexible File Layout specifying
mirrored Data Servers, it must do the writes and commits to all mirrors.
This patch modifies the client to use a taskqueue to perform these writes
and commits concurrently.
The number of threads can't be changed for taskqueue(9), so it is set
to 4 * mp_ncpus by default, but this can be overridden by setting the
sysctl vfs.nfs.pnfsiothreads.

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

6 years agombuf(9): unbreak m_fragment()
avos [Mon, 16 Oct 2017 21:46:11 +0000 (21:46 +0000)]
mbuf(9): unbreak m_fragment()

- Fix it by replacing m_cat() with m_prev->m_next = m_new
(m_cat() will try to append data - as a result, there will be no
fragmentation).
- Move some constants out of the loop.

Was previously tested with D4077.

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

6 years agoifnet(9): split ifc_alloc_unit() (should simplify code flow)
avos [Mon, 16 Oct 2017 21:21:31 +0000 (21:21 +0000)]
ifnet(9): split ifc_alloc_unit() (should simplify code flow)

Allocate smallest unit number from pool via ifc_alloc_unit_next()
and exact unit number (if available) via ifc_alloc_unit_specific().

While here, address possible deadlock (mentioned in PR).

PR: 217401
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D12551

6 years agoRe-evaluate thread' signal mask after ptracestop().
kib [Mon, 16 Oct 2017 20:21:51 +0000 (20:21 +0000)]
Re-evaluate thread' signal mask after ptracestop().

The stop drops process lock, which allows the signal mask to be
changed and our selected signal might become blocked, i.e. should be
returned to the process queue instead of delivery.

Also, for the existing check of the process no longer having an
attached debugger, we should not loose the signal, but requeue it.

Reported and tested by: bdrewery
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoImprove assertion that an ignored or blocked signal is not delivered.
kib [Mon, 16 Oct 2017 20:15:19 +0000 (20:15 +0000)]
Improve assertion that an ignored or blocked signal is not delivered.

Split two conditions into separate asserts.  Print additional details,
like the signal number and action value.

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

6 years agoStyle.
kib [Mon, 16 Oct 2017 20:11:29 +0000 (20:11 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoThis child is expected to exit on SIGTRAP, don't leave a core behind.
bdrewery [Mon, 16 Oct 2017 20:06:24 +0000 (20:06 +0000)]
This child is expected to exit on SIGTRAP, don't leave a core behind.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoAdd a quick description of the geom_getxml(3), geom_xml2tree(3),
romain [Mon, 16 Oct 2017 17:21:52 +0000 (17:21 +0000)]
Add a quick description of the geom_getxml(3), geom_xml2tree(3),
geom_gettree(3) and geom_deletetree(3) functions provided by libgeom and are
not documented in libgeom(3).

Reviewed by: mav, bjk, allanjude
Approved by: allanjude
Differential Revision: https://reviews.freebsd.org/D12679

6 years agoProperly reset the fields in clean_unrhdr.
mjoras [Mon, 16 Oct 2017 16:14:50 +0000 (16:14 +0000)]
Properly reset the fields in clean_unrhdr.

In r324542 I neglected to reset the first and last fields of struct
unrhdr. This causes a tmpfs to fail the unr(9) consistency checks with
DIAGNOSTIC on. Fix this by resetting the fields by calling init_unrhdr.
While here, change a loop to use TAILQ_FOREACH_SAFE since it is more
readable and equally fast.

Reported by: David Wolfskill <david@catwhisker.org>
Approved by: rstone (mentor)
Sponsored by: Dell EMC Isilon

6 years agoFix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk().
kib [Mon, 16 Oct 2017 15:16:24 +0000 (15:16 +0000)]
Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk().

For processing, reclaim_pv_chunk() removes the pv_chunk from the lru
list, which makes pc_lru linkage invalid.  Then the pmap lock is
released, which allows for other thread to free the last pv entry
allocated from the chunk and call free_pv_chunk(), which tries to
modify the invalid linkage.

Similarly, the chunk is inserted into the private tailq new_tail
temporary.  Again, free_pv_chunk() might be run and corrupt the
linkage for the new_tail after the pmap lock is dropped.

This is a consequence of r299788 elimination of pvh_global_lock, which
allowed for reclaim to run in parallel with other pmap calls which
free pv chunks.

As a fix, do not remove the chunk from pc_lru queue, use a marker to
remember the position in the queue iteration.  We can safely operate
on the chunks after the chunk's pmap is locked, we fetched the chunk
after the marker, and we checked that chunk pmap is same as we have
locked, because chunk removal from pc_lru requires both pv_chunk_mutex
and the pmap mutex owned.

Note that the fix lost an optimization which was present in the
previous algorithm.  Namely, new_tail requeueing rotated the pv chunks
list so that reclaim didn't scan the same pv chunks that couldn't be
freed (because they contained a wired and/or superpage mapping) on
every invocation.  An additional change is planned which would improve
this.

Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agopf tests: Use pft_set_rules everywhere
kp [Mon, 16 Oct 2017 15:05:32 +0000 (15:05 +0000)]
pf tests: Use pft_set_rules everywhere

We now have a utility function to set pf rules in the jail. Use it
whenever we need to set the pf rules in the test jail.

6 years agopf tests: Basic IPv6 forwarding tests
kp [Mon, 16 Oct 2017 15:03:45 +0000 (15:03 +0000)]
pf tests: Basic IPv6 forwarding tests

Pass/block packets in the forwarding path with pf.

Introduce the pft_set_rules() helper function, because we need to
remember to flush states between individual tests. If not we can get
packets passing despite rules blocking them because they match states
created in a previous test.

Extend pft_ping.py to be able to send IPv6 echo requests.

6 years agopf: test set-tos
kp [Mon, 16 Oct 2017 15:01:49 +0000 (15:01 +0000)]
pf: test set-tos

Introduce tests for the set-tos feature of pf. Teach pft_ping.py to send
and verify ToS flags.

6 years agoAdd Creative vendor ID.
mav [Mon, 16 Oct 2017 12:54:53 +0000 (12:54 +0000)]
Add Creative vendor ID.

MFC after: 1 week

6 years agoSave VFP state in getcontext(3) on ARM.
mmel [Mon, 16 Oct 2017 12:53:54 +0000 (12:53 +0000)]
Save VFP state in getcontext(3) on ARM.
This is a last followup of r315974, which fixes userland part
of VFP save/restore problems described in PR 217611.

PR: 217611
MFC after: 2 weeks

6 years agoUpdate details of interface capabilities changed by bridge(4).
mav [Mon, 16 Oct 2017 12:32:57 +0000 (12:32 +0000)]
Update details of interface capabilities changed by bridge(4).

PR: 221122
MFC after: 1 week

6 years agowlandebug(8): add a sanity check.
avos [Mon, 16 Oct 2017 07:15:50 +0000 (07:15 +0000)]
wlandebug(8): add a sanity check.

6 years agowlandebug(8): obtain original interface name via ifconfig_get_orig_name()
avos [Mon, 16 Oct 2017 07:01:27 +0000 (07:01 +0000)]
wlandebug(8): obtain original interface name via ifconfig_get_orig_name()

6 years agolibifconfig: allow to get original interface name via ifconfig_get_orig_name()
avos [Mon, 16 Oct 2017 06:54:26 +0000 (06:54 +0000)]
libifconfig: allow to get original interface name via ifconfig_get_orig_name()

Uses the same method as in tools/tools/ifinfo/ifinfo.c
(via net.link.generic sysctl).

Tested with modified wlandebug(8).

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

6 years agoRemove the libstand directory which is now empty.
delphij [Mon, 16 Oct 2017 04:46:28 +0000 (04:46 +0000)]
Remove the libstand directory which is now empty.

6 years agoExplicitly inlcude SYSDIR in the include path -- need machine path too?
imp [Mon, 16 Oct 2017 03:59:58 +0000 (03:59 +0000)]
Explicitly inlcude SYSDIR in the include path -- need machine path too?

6 years agoLOADER_foo_SUPPORTED
imp [Mon, 16 Oct 2017 03:59:52 +0000 (03:59 +0000)]
LOADER_foo_SUPPORTED

6 years agoMove all the ficl common code into ficl.mk
imp [Mon, 16 Oct 2017 03:59:44 +0000 (03:59 +0000)]
Move all the ficl common code into ficl.mk

There's a number of copies of basically identical code to enable
building forth in /boot/loader. Move it all into ficl.mk.

6 years agocreate defs.mk for common definitions
imp [Mon, 16 Oct 2017 03:59:38 +0000 (03:59 +0000)]
create defs.mk for common definitions

6 years agotweak style
imp [Mon, 16 Oct 2017 03:59:33 +0000 (03:59 +0000)]
tweak style

6 years agoMove common/Makefile.inc to sys/boot/loader.mk.
imp [Mon, 16 Oct 2017 03:59:28 +0000 (03:59 +0000)]
Move common/Makefile.inc to sys/boot/loader.mk.

Makefile.inc has a specific meaning in the tree, and
common/Makefile.inc doesn't quite fit into that. Rename it to
loader.mk and it will be a place to collect common things to all
/boot/loader programs there.

Sponsored by: Netflix

6 years agoRename top level Makefile.ficl to ficl.mk.
imp [Mon, 16 Oct 2017 03:59:22 +0000 (03:59 +0000)]
Rename top level Makefile.ficl to ficl.mk.

6 years agoMove orphaned man pages into new man directory from common. This helps
imp [Mon, 16 Oct 2017 03:59:17 +0000 (03:59 +0000)]
Move orphaned man pages into new man directory from common. This helps
keep cleaer that common is just for the MI files for /boot/loader
programs.

Sponsored by: Netflix

6 years agoUnify boot1 with loader
imp [Mon, 16 Oct 2017 03:59:11 +0000 (03:59 +0000)]
Unify boot1 with loader

Refactor boot1 to use the same I/O code as /boot/loader uses. Refactor
to use the common efi_main.c.

Submitted by: Eric McCorkle
Differential Revision: https://reviews.freebsd.org/D10447

6 years agoZero out the ccb's alloated on the stack for the dump routines to more
imp [Sun, 15 Oct 2017 23:54:04 +0000 (23:54 +0000)]
Zero out the ccb's alloated on the stack for the dump routines to more
closely match a ccb returned from xpt_get_ccb().

Sponsored by: Netflix

6 years agoCloser examination shows that nvme and CAM both normally zero-fill
imp [Sun, 15 Oct 2017 23:53:55 +0000 (23:53 +0000)]
Closer examination shows that nvme and CAM both normally zero-fill
allocations (for req and ccb, which ultimately contain the
nvme_cmd). As such, we can micro-optimize these routines. Add a
comment to this effect, and bzero the ccb used to make the requests
for the nda dump rotuine so it more closely matches a ccb allocated
with xpt_get_ccb().

Sponsored by: Netflix

6 years agoFix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1.
rmacklem [Sun, 15 Oct 2017 22:22:27 +0000 (22:22 +0000)]
Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1.

The client IP address was not being reported for some NFSv4 mounts by
nfsdumpstate. Upon investigation, two problems were found for mounts
using IPv4. One was that the code (originally written and tested on i386)
assumed that a "u_long" was a "uint32_t" and would exactly store an
IPv4 host address. Not correct for 64bit arches.
Also, for NFSv4.1 mounts, the field was not being filled in. This was
basically correct, because NFSv4.1 does not use a callback address.
However, it meant that nfsdumpstate could not report the client IP addr.
This patch should fix both of these issues.
For IPv6, the address will still not be reported. The original NFSv4 RFC
only specified IPv4 callback addresses. I think this has changed and, if so,
a future commit to fix reporting of IPv6 addresses will be needed.

Reported by: manu
PR: 223036
MFC after: 2 weeks