delphij [Thu, 27 Mar 2014 00:24:48 +0000 (00:24 +0000)]
MFC r262501:
Refresh our implementation of OpenBSD's Blowfish password format.
Notable changes:
- Support of $2b$ password format to address a problem where very
long passwords (more than 256 characters, when an integer
overflow would happen and cause the length to wrap at 256).
- Updated pseudo code in comments to reflect the reality.
- Removed our local shortcut of processing magic string and rely
on the centralized and tigntened validation.
- Diff reduction from upstream.
For now we are still generating the older $2a$ format of password
but we will migrate to the new format once the format is formally
finalized.
dim [Sun, 23 Mar 2014 14:18:40 +0000 (14:18 +0000)]
Turn off warnings for building aicasm. Various versions of yacc exist,
which can result in different warnings-as-errors in this tool, but these
are all completely harmless.
This is a direct commit to stable/7, stable/8, stable/9 and stable/10,
since this kernel build tool has already been removed in head.
brueffer [Sun, 23 Mar 2014 13:06:27 +0000 (13:06 +0000)]
MFC: r262273
Further refine the auth fail regex to catch more auth failures and
reduce false positives.
The committed patch was provided by Christian Marg.
PR: 91732
Submitted by: Daniel O'Connor <doconnor at gsoft.com.au>
Skye Poier <spoier at gmail.com>
Alan Amesbury <amesbury at umn.edu>
Christian Marg <marg at rz.tu-clausthal.de>
FreeBSD porting notes: the kernel part of this changeset depends
on Solaris buf(9S) interfaces and are not really applicable for
our use. vdev_disk.c is patched as-is to reduce diverge from
upstream, but vdev_file.c is left intact.
delphij [Wed, 19 Mar 2014 19:33:55 +0000 (19:33 +0000)]
Make it possible to call VOP_PUTPAGES with shared vnode lock instead
of insisting an exclusive lock.
When VFS_LOCK_DEBUG is enabled and when the underlying file system is
capable of MNT_SHARED_WRITES, a failed assertion may lead to a panic
because when calling fsync(2), a.k.a. sys_fsync() over a vnode with
mmap'ed page, it will grab a shared lock when underlying file system
is capable, then call vm_object_page_clean that eventually proceeded
to vnode_pager_putpages() that tries to do VOP_PUTPAGES, where
VOP_PUTPAGES_APV generated from the declaration asserts the vnode is
always exclusively locked by caller.
This is a direct commit to stable/8 because a majority portion of the
original changeset 257899 (kib), which main goal was an optimization,
was omitted. We saw the panic independently in a FreeNAS bug ticket
(#4578).
jhb [Tue, 18 Mar 2014 17:17:42 +0000 (17:17 +0000)]
Increment fi_wgen before awakening threads polling the read socket of a
FIFO. Previously, a thread sleeping in poll() could be awakened and
re-poll the FIFO with the old value of fi_wgen (and thus improperly
setting POLLINIGNEOF) before a thread closing a writable fifo descriptor
bumped fi_wgen. The end result was that the reading thread in poll()
would never see POLLHUP but could block forever (or until a timeout).
This is a direct commit to 8 and 9 since the FIFO code is implemented
differently in 10.x and later. The pipe-backed FIFOs in 10 do not have
this bug.
delphij [Mon, 17 Mar 2014 19:09:39 +0000 (19:09 +0000)]
MFC r262676:
All callers of static method load_nvlist() in spa.c handles error case,
so there is no reason to assert that we won't hit an error. Instead,
just return that error to caller and have the upper layer handle it.
Obtained from: FreeNAS
Reported by: rodrigc
Reviewed by: Matthew Ahrens
hselasky [Fri, 14 Mar 2014 10:30:17 +0000 (10:30 +0000)]
MFC r227751, r238766, r241553, r242748, r244047, r245947, r246021, r247255,
r249039, r249204, r250848, r251351, r252295, r252498, r255123, r255238,
r256782, r257132, r257390 and r259675:
- Add various new USB ID's and quirks.
- Make sure the usbdevs mergeinfo gets recorded on the sys directory.
mav [Fri, 14 Mar 2014 07:58:11 +0000 (07:58 +0000)]
MFC r262886:
Fix support for increased logical sector size (4K-native drives).
- Logical sector size is measured in words, not bytes.
- If physical sector is not bigger then logical sector, it does not mean
it should be set equal to 512 bytes, but set to logical sector.
PR: misc/187269
Submitted by: Ravi Pokala <rpokala@panasas.com>
brueffer [Sat, 8 Mar 2014 12:26:17 +0000 (12:26 +0000)]
MFC: r262333
Simplify the way the end of a singly linked list is followed (for adding
items), so it is more obvious that we aren't going to indirect through
a NULL pointer.
PR: 144723
Submitted by: Garrett Cooper <yaneurabeya at gmail.com>
Obtained from: NetBSD r1.19
brueffer [Tue, 25 Feb 2014 07:59:33 +0000 (07:59 +0000)]
MFC: r261773
In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously
this could lead to the -n option effectively being ignored (in case
ac_line happened to be 0 aka SRC_AC), or other undefined behaviour.
PR: 169779
Submitted by: Alex Gonzalez <loox at e-shell.com>
Reviewed by: jhb
eadler [Mon, 24 Feb 2014 17:03:02 +0000 (17:03 +0000)]
MFC r261774 by feld:
Add caveat to zpool manpage indicating that we do not automatically activate
hot spares. This should be MFC'd to all STABLE branches.
Upon the availability of zfsd, the zpool manpage on relevant branches should
be updated to remove this caveat and document hot spare's reliance on zfsd.
hselasky [Sun, 23 Feb 2014 13:13:59 +0000 (13:13 +0000)]
MFC r261795:
Issue doorbell twice before finally freeing the DMA descriptors. This
should fix DMA descriptor caching issues seen with the EHCI controller
found in Google Chromebook C720 during removal and insertion of USB
devices.
delphij [Sat, 22 Feb 2014 01:13:48 +0000 (01:13 +0000)]
MFC r261620: MFV r261619:
4574 get_clones_stat does not call zap_count in non-debug kernel
zap_count(...) is never called in non-DEBUG kernel.
As result "count" variable is always 0, and "goto fail" is always
reached. This means get_clones_stat function never makes up list
of clones for "clones" properties.
delphij [Sat, 22 Feb 2014 00:41:03 +0000 (00:41 +0000)]
MFC r261618:
In g_eli_crypto_hmac_init(), zero out after using the ipad buffer,
k_ipad.
Note that the two consumers in geli(4) are not affected by this
issue because the way the code is constructed and as such, we
believe there is no security impact with or without this change
with geli(4)'s usage.
Reported by: Serge van den Boom <serge vdboom.org>
Reviewed by: pjd
jhb [Wed, 19 Feb 2014 19:28:49 +0000 (19:28 +0000)]
MFC 261512,261514:
- Partially revert r52493 and change client side interval statistics to
report the actual number of RPCs issued, not the theoretical number
that would be issued if all caching was disabled.
- Use the DELTA() macro to tidy the server-side interval stats code a bit.
jhb [Wed, 19 Feb 2014 18:35:22 +0000 (18:35 +0000)]
MFC 261524:
Properly set the alignment flags when allocating the initial range for a
BAR. This only really matters when pci_do_realloc_bars is enabled and
the initial allocation of a specific range fails.
jhb [Tue, 18 Feb 2014 20:16:32 +0000 (20:16 +0000)]
MFC 261518:
- Update a few places to account for va_copy().
- Create a separate 'return values' section and move some statements about
return values to that section.
- Note that each invocation of va_start() and va_copy() must be paired with
va_end() in the same function.
jhb [Mon, 17 Feb 2014 22:19:49 +0000 (22:19 +0000)]
MFC 260926:
Add support for displaying VPD for PCI devices via pciconf.
- Store the length of each read-only VPD value since not all values are
guaranteed to be ASCII values (though most are).
- Add a new pciio ioctl to fetch VPD for a single PCI device. The values
are returned as a list of variable length records, one for the device
name and each keyword.
- Add a new -V flag to pciconf's list mode which displays VPD data for
each device.
markj [Mon, 17 Feb 2014 05:06:43 +0000 (05:06 +0000)]
MFC r249514 (by gnn):
Point args[0] not at the thread that is ending but at the one that
is starting. This is in line with practice in OpenSolaris.
Note that this change is only in ULE and not in the 4BSD scheduler.
Once this change settles in (MFC timeout has expired) we'll try it out
on 4BSD as well.
MFC r260043:
The arguments to sched:::off-cpu are the thread and associated process of
the thread selected to run, not the currently running thread.
hselasky [Fri, 7 Feb 2014 07:34:47 +0000 (07:34 +0000)]
MFC r244535, r245995, r261505 and r258961:
- Use a boundary of zero, hence a PAGE_SIZE boundary
is implied by all memory allocations.
- Fix an external compiler warning about write-only
assigned variable.
hselasky [Tue, 4 Feb 2014 09:03:14 +0000 (09:03 +0000)]
MFC r261228:
When detaching a [USB] keyboard, keys might still be pressed. Ensure
that all pressed keys are released before completing the USB keyboard
detach. This will prevent so-called "ghost-keys" from appearing after
that the USB device generating the key event(s) has been detached.