mav [Thu, 5 Jan 2017 11:34:30 +0000 (11:34 +0000)]
MFC r310284:
When writing fixed format sense data, set VALID bit only if provided value
for INFORMATION field fit into available 4 bytes (has no non-zero bytes
except last 4), as explicitly required by SPC-5 specification.
mav [Thu, 5 Jan 2017 11:03:58 +0000 (11:03 +0000)]
MFC r310257: Improve support for informational exceptions.
While CTL still has no real events to report in this way (like SMART),
it is possible to trigger false event by manually setting TEST bit in
Informational Exceptions Control mode page, that can be useful for
initiator testing. This code supports all flavours of IE reporting:
UNIT ATTENTION, RECOVERED ERROR and NO SENSE sense keys, REQUEST SENSE
command and Informational Exceptions log page.
mav [Thu, 5 Jan 2017 11:02:27 +0000 (11:02 +0000)]
MFC r310230:
Don't treat informational exceptions (warnings and impending failures)
a.k.a. SCSI SMART events as errors. Log them to console and continue.
mav [Thu, 5 Jan 2017 11:00:27 +0000 (11:00 +0000)]
MFC r309297: Make SES status updates more aggressive.
- On control request update all status pages, since they may also be
affected if user enables/disables enclosure slots.
- Periodically update element descriptors too, since there is some
hardware where they are changed dynamically.
sephe [Thu, 5 Jan 2017 08:38:27 +0000 (08:38 +0000)]
MFC 310347
hyperv/storvsc: The max channel in PDU actually means the max sub-chans.
Use proper name for local variables. PDU fields' name was not changed yet.
While I'm here, make # of usable channels tunable. This eases further
testing.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8851
sephe [Thu, 5 Jan 2017 06:21:14 +0000 (06:21 +0000)]
MFC 309726,309728
309726
hyperv/storvsc: Fix the SCSI disk attachment issue.
On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disks
fails to attach. Mainly because those versions of Hyper-V do not set
SRB_STATUS properly and deliver junky INQUERY responses.
Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reported by: Hongxiong Xian <v-hoxian microsoft com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8724
309728
hyperv/storvsc: Minor style changes; no functional changes.
sephe [Thu, 5 Jan 2017 04:59:37 +0000 (04:59 +0000)]
MFC 309085
hyperv/hn: Fix primary channel revocation
Since hypervisor will not drain the TX bufring, once the channels are
revoked:
- Setup vmbus orphan handler properly.
- Make sure that suspension will not wait the TX bufring draining
forever.
- GC the pending TX descs on detach path, before freeing the busdma
stuffs.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8559
sephe [Thu, 5 Jan 2017 04:22:03 +0000 (04:22 +0000)]
MFC 309030,309039,309080,309081,309083
309030
hyperv/vmbus: Set a mark on the revoked channel.
This will be used to fix device detach DEVMETHOD for revoked primary
channel.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8522
309039
hyperv/vmbus: Merge free/active locks.
These functions are only used by management stuffs, so there are
no needs to introduce extra complexity.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8524
309080
hyperv/vmbus: Implement orphan support for transaction API
It will be used to fix the primary channel revocation support.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8525
309081
hyperv/vmbus: Fix the primary channel revoking on vmbus side.
Drivers can now use vmbus_chan_{is_revoked,set_orphan,unset_orphan}() and
vmbus_xact_ctx_orphan() to fix their attach/detach DEVMETHODs for revoked
primary channels.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8545
309083
hyperv/vmbus: Fix the multi-channel revoking on vmbus side.
- Reference count the sub-channel when channel offer message is
processed, so that immediate rescind message on the same channel
will not race sub-channel open on driver side.
- Drop the above reference when sub-channel is closed, this closely
mimics the hypervisor's reaction when primary channel is closed
on the VM side. No drivers use sub-channel after primary channel
is closed.
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8546
sephe [Thu, 5 Jan 2017 03:20:00 +0000 (03:20 +0000)]
MFC 308664,308742,308743
308664
hyperv/vss: Add driver and tools for VSS
VSS stands for "Volume Shadow Copy Service". Unlike virtual machine
snapshot, it only takes snapshot for the virtual disks, so both
filesystem and applications have to aware of it, and cooperate the
whole VSS process.
This driver exposes two device files to the userland:
/dev/hv_fsvss_dev
Normally userland programs should _not_ mess with this device file.
It is currently used by the hv_vss_daemon(8), which freezes and
thaws the filesystem. NOTE: currently only UFS is supported, if
the system mounts _any_ other filesystems, the hv_vss_daemon(8)
will veto the VSS process.
If hv_vss_daemon(8) was disabled, then this device file must be
opened, and proper ioctls must be issued to keep the VSS working.
/dev/hv_appvss_dev
Userland application can opened this device file to receive the
VSS freeze notification, hold the VSS for a while (mainly to flush
application data to filesystem), release the VSS process, and
receive the VSS thaw notification i.e. applications can run again.
The VSS will still work, even if this device file is not opened.
However, only filesystem consistency is promised, if this device
file is not opened or is not operated properly.
hv_vss_daemon(8) is started by devd(8) by default. It can be disabled
by editting /etc/devd/hyperv.conf.
Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reviewed by: kib, mckusick
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8224
308742
hyperv/vss: Nuke unused variables.
Submitted by: markj
Reported by: markj
Sponsored by: Microsoft
308743
hyperv/vss: Install the userland daemon to /usr/sbin instead of /
Submitted by: markj
Reported by: markj
Sponsored by: Microsoft
gonzo [Thu, 5 Jan 2017 00:26:57 +0000 (00:26 +0000)]
MFC r310170, r310492
r310170:
[spigen] Make "data" part of spigen_transfer optional
Make st_data part of spigen_transfer optional by letting pass zero length
and NULL pointer. SPI controller drivers handle this case fine.
r310492:
[spigen] Fix spigen attaching as a driver for SPI devices nodes in FDT
Return BUS_PROBE_NOWILDCARD in probe method to make sure that spigen
attaches only to the device created in identify method.
Before this change spigen probe method used to return 0 which meant it
competed with other drivers to be attached to the devices created for
child nodes of SPI bus node in FDT.
hiren [Wed, 4 Jan 2017 18:03:27 +0000 (18:03 +0000)]
MFC r309858
We currently don't do TSO if ip options are present. In case of IPv6, we look at
in6p_options to check that. That is incorrect as we carry ip options in
in6p_outputopts. Also, just checking for in6p_outputopts being NULL won't
suffice as we combine ip options and ip header fields both in that one field.
The commit fixes this by using ip6_optlen() which correctly calculates length
of only ip options for IPv6.
fabient [Wed, 4 Jan 2017 16:36:51 +0000 (16:36 +0000)]
MFC r308216:
In rtadvd, interface lookup calls if_indextoname() many times in a loop,
(it takes a long time on systems with many interfaces)
without reason and without checking its return value.
pfg [Wed, 4 Jan 2017 02:51:39 +0000 (02:51 +0000)]
MFC r311012
Remove some uses of the GCC __nonnull() attribute.
While the checks are considered useful, the attribute does dangerous
optimizations, removing NULL checks where they can be needed. Remove the
uses of this attribute introduced in r281130: the changes were inspired on
Google's bionic where this attribute is not used anymore.
In general, the __nonnull() attribute has fulfilled its roll and will be
replaced with the Clang _Nonnull qualifier in the future.
emaste [Tue, 3 Jan 2017 15:59:39 +0000 (15:59 +0000)]
MFC r309411: Retire long-broken/unused static rtld support
rtld-elf has some vestigial support for building as a static executable.
r45501 introduced a partial implementation with a prescient note that it
"might never be enabled." r153515 introduced ELF symbol versioning
support, and removed part of the unused build infrastructure for static
rtld.
GNU ld populates rela relocation addends and GOT entries with the same
values, and rtld's run-time dynamic executable check relied on this.
Alternate toolchains may not populate the GOT entries, which caused
RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the
unused check.
If we want to restore static rtld support later on we ought to introduce
a build-time #ifdef flag.
emaste [Tue, 3 Jan 2017 15:57:47 +0000 (15:57 +0000)]
MFC r310634: elfcopy: fix PE object section name corruption and crash
Fixed a bug that the PE object section names are generated incorrectly
using the section name table found in the original input ELF object
instead of the intermediate ELF object.
Ticket: #541
Do not try to copy section content from a NULL d_buf when creating
uninitialized data COFF section for PE object.
Fixed vendor issues (relevant to FreeBSD)
#825, #832: Add sanity check of tar "uid, "gid" and "mtime" fields
#830, #831, #833, #846: Spelling fixes
#850: Fix issues with reading certain jar files
Fixed issues found by Google OSS-Fuzz:
OSS-Fuzz #15: Fix heap-buffer-overflow in archive_le16dec()
OSS-Fuzz #16: Fix possible hang in uudecode_filter_read()
OSS-Fuzz #139, #145, #152: Fix heap-buffer-overflow in uudecode_bidder_bid()
OSS-Fuzz #220: Reject an 'ar' filename table larger than 1GB or a filename
larger than 1MB
OSS-Fuzz #227, #230, #239: Fix possible memory leak in archive_read_free()
OSS-Fuzz #237: Fix heap buffer overflow when reading invalid ar archives
OSS-Fuzz #286: Bugfix in archive_strncat_l()
More information:
https://github.com/libarchive/libarchive/issues/[libarchive_issue_number]
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=[oss_fuzz_issue_number]