Commit Graph

194553 Commits

Author SHA1 Message Date
delphij
defa475beb MFC r260636:
Fix bsnmpd remote denial of service vulnerability.

Reported by:	dinoex
Submitted by:	harti
Security:	FreeBSD-SA-14:01.bsnmpd
Security:	CVE-2014-1452
2014-01-14 19:02:14 +00:00
pfg
b405aa87ad MFC r260545:
ext2fs: fix inode flag conversion.

After r252890 we are naively attempting to pass through the
inode flags.  This is technically incorrect as the ext2
inode flags don't match the UFS/system values used in
FreeBSD and a clean conversion is needed.

Some filtering was left in place so the change didn't cause
significant changes in FreeBSD but some of the garbage passed
is likely to be the cause for warning messages in linux.

Fix the issue by resetting the flags before conversion as was
done previously. This also means we will not pass the EXT4_*
inode flags into FreeBSD's inode.

PR:		kern/185448
2014-01-14 15:20:33 +00:00
pluknet
5889b488e3 MFC r257705:
Clean up -Wtautological-compare -Wformat warnings.
2014-01-14 14:03:28 +00:00
mav
204096a62c MFC r260541, r260547:
Take additional reference on SCSI probe periph to cover its freeze count.

Otherwise periph may be invalidated and freed before single-stepping freeze
is dropped, causing use after free panic.
2014-01-14 12:01:36 +00:00
pluknet
a7224392fd MFC r259921,259950:
Provide the manual page for aio_fsync(2).
2014-01-14 09:49:42 +00:00
delphij
139f0a076d MFC r259811:
MFV r258373:

4168 ztest assertion failure in dbuf_undirty

4169 verbatim import causes zdb to segfa
4170 zhack leaves pool in ACTIVE state

illumos/illumos-gate@7fdd916c47
2014-01-14 01:28:08 +00:00
bdrewery
f8756761dd MFC r260605:
Remove scary comment about this being a test key.

  There has been no need to regenerate the signing key.

Early MFC as it is just a comment and needs to get into releng/10.0.

Approved by:	bapt (mentor, implicit)
2014-01-13 22:07:36 +00:00
delphij
d17709df94 MFC r260110:
Eliminate unused drbr_stats_update implementation in oce(4) driver.

Noticed by:	dim
2014-01-13 19:34:23 +00:00
jilles
9033033601 MFC r260336,r260355: find: Fix -lname and -ilname:
* Take into account that readlink() does not add a terminating '\0'.

* Do not match symlinks that are followed because of -H or -L. This is
  explicitly documented in GNU find's info file and is like -type l.

* Fix matching symlinks in subdirectories when fts changes directories.

As before, symlinks of length PATH_MAX or more are not handled correctly.
(These can only be created on other operating systems.)

Also, avoid some readlink() calls on files that are obviously not symlinks
(because of fts(3) restrictions, not all of them).

PR:		bin/185393
Submitted by:	Ben Reser (parts, original version)
2014-01-12 23:17:56 +00:00
jmmv
97eeccbbec MFC r260491: Use .cpp as the extension for temporary C++ files. 2014-01-12 22:17:56 +00:00
pfg
f630f6f40f MFC r260310:
libcpp: misc fixes from Apple's GCC.

Fixes some bugs detected by Apple:
  #error with unmatched quotes
  pragma mark

Obtained from:	Apple GCC 4.2 - 5553
2014-01-12 21:16:26 +00:00
pfg
d54137712a MFC r259920:
gcc: Implement -Wmost for compatibility with clang.

This is equivalent to -Wall -Wno-parentheses.

Obtained from:	Apple GCC 4.2 - 5531
2014-01-12 20:09:17 +00:00
dim
efe1ed4163 MFC r260494:
Fix a braino with r259730: we cannot currently use CFLAGS.gcc or
CFLAGS.clang in sys/conf/Makefile.arm, since the main kernel build does
not use <bsd.sys.mk>.  So revert that particular change for now.

Pointy hat to:	me
Noticed by:	zbb
2014-01-12 14:37:39 +00:00
remko
dfee5da730 MFC r260446
virtio-block does not exist, the correct name is virtio-blk.

  PR:	    185573
  Submitted by:    Allan Jude
  Facilitated by: Snow B.V.
2014-01-11 23:10:59 +00:00
hselasky
2d29b474fb MFC r260184:
Minor correction for the XHCI reset logic.
2014-01-11 08:21:13 +00:00
pfg
f5cc643aac MFC r260361:
gcc: Fix optimization bug.

GCC-PR rtl-optimization/34628
	* combine.c (try_combine): Stop and undo after the first combination
	if an autoincrement side-effect on the first insn has effectively
	been lost.
2014-01-11 01:44:22 +00:00
asomers
6b686ee50a MFC 259339
sbin/devd/devd.cc
        Increase the size of devd's client socket's send buffer from the
        default (8k) to 128k.  This prevents clients from getting
        POLLHUPped during event storms.  For example, during zpool creation,
        the kernel emits a resource.fs.zfs.statechange event for every vdev
        in the pool.  A 128k buffer is large enough to hold the statechange
        events for a pool with nearly 800 drives.

MFC 259362
    sbin/devd/devd.cc
        Promoting the SIGINFO handler's log message from LOG_INFO to
        LOG_NOTICE, and promoting the "Processing event ..." message from
        LOG_DEBUG to LOG_INFO.  Setting the logfile to LOG_NOTICE with this
        change will have the same result as setting it to LOG_INFO without
        this change.  Setting it to LOG_INFO with this change will include
        the useful "Processing event ..." messages that were previously at
        LOG_DEBUG, without including useless messages like "Pushing table".

        The intent of this change is that one can log "Processing event ..."
        without logging "Pushing table" and related messages that are sent
        for every event.  The number of lines actually logged is reduced by
        about 75% by making this change and setting syslog to LOG_INFO vs
        setting syslog to LOG_DEBUG.

    etc/syslog.conf
        Changing the recommended loglevel to notice instead of info.
2014-01-10 17:56:23 +00:00
asomers
d1a85fc0d9 MFC 259240
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
        When a da or ada device dissappears, outstanding IOs fail with
        ENXIO, not EIO.  The check for EIO was probably copied from Illumos,
        where that is indeed the correct errno.

        Without this change, pulling a busy drive from a zpool would usually
        turn it into UNAVAIL, even though pulling an idle drive would turn
        it into REMOVED.  With this change, it is REMOVED every time.

        Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that
        results in devd getting two resource.fs.zfs.removed events.  The
        comment said that the event had to be sent directly instead of
        through the async removal thread because "the DE engine is using
        this information to discard prevoius I/O errors".  However, the fact
        that vdev_geom_io_intr was never actually sending the events until
        now, and that vdev_geom_orphan never sent them at all, and that
        vdev_geom_orphan usually gets called about 2 seconds after the
        actual removal, means that FreeBSD's userland can cope with a late
        event just fine.
2014-01-10 16:56:59 +00:00
ae
65169ca8a0 MFC r260151 (by adrian):
Use an RLOCK here instead of an RWLOCK - matching all the other calls
  to lla_lookup().

  This drastically reduces the very high lock contention when doing parallel
  TCP throughput tests (> 1024 sockets) with IPv6.

MFC r260187:
  lla_lookup() does modification only when LLE_CREATE is specified.
  Thus we can use IF_AFDATA_RLOCK() instead of IF_AFDATA_LOCK() when doing
  lla_lookup() without LLE_CREATE flag.

MFC r260217:
  Add IF_AFDATA_WLOCK_ASSERT() in case lla_lookup() is called with
  LLE_CREATE flag.
2014-01-10 09:45:28 +00:00
ae
2865f87f4a MFC r259634:
Prevent users from deactivating the last component of a mirror.

MFC r259929:
  Add an ability to stop gmirror and clear its metadata in one command.
  This fixes the problem, when gmirror starts again just after stop.

  The problem occurs when gmirror's component has geom label with equal size.
  E.g. gpt and gptid have the same size as partition, diskid has the same
  size as entire disk. When gmirror's geom has been destroyed, glabel
  creates its providers and this initiate retaste.

  Now "gmirror destroy" command is available. It destroys geom and also
  erases gmirror's metadata.

PR:		184985
2014-01-10 07:48:36 +00:00
ae
5308ec5802 MFC r258357:
Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
  Now it is easy to expand the size of the mirror when all its components
  are replaced. Also add g_resize method to geom_mirror class. It will write
  updated metadata to new last sector, when parent provider is resized.
2014-01-10 07:43:40 +00:00
wblock
a956d3e4f7 MFC r260358
Fix a cut and paste error.
2014-01-09 23:51:47 +00:00
dim
01c13c7d48 MFC r260334:
Split the last gcc-specific flags off into CFLAGS.gcc.  This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC r260369:

Apply band-aid for 32-bit compat libs failures after r260334: put back
-Qunused-arguments for clang for now, until I can figure out a way to
make it unneeded in all scenarios.  Sorry about the breakage.
2014-01-09 23:08:56 +00:00
dim
999774a8ef MFC r260102:
Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile.  Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.

MFC r260322:

In addition to r260102, also define GCC_MS_EXTENSIONS in bsd.sys.mk,
since kernel module builds do not use kern.pre.mk.
2014-01-09 22:40:51 +00:00
loos
837513035e MFC r257064:
Add an OFW SPI compatible bus.  Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by:	ray
Approved by:	adrian (mentor)
2014-01-09 18:28:58 +00:00
mav
263d261fe5 MFC r258683:
Escape special XML chars, returned by some devices, confusing XML parsers.
2014-01-09 11:13:03 +00:00
mav
3b6d8c3206 MFC r258220, r258251:
Implement automatic live resize support for GEOM MULTIPATH class.

In "manual" mode just automatically resize provider in any direction.
In "automatic" mode allow growth (with new metadata write); in case of
shrinking check if there is already valid metadata found at the new
location.  This should allow easy transparent recovery if first resize
was done by mistake.

While there, unify metadata write code and fix minor memory leak.
2014-01-09 11:11:47 +00:00
mav
f9a52747b5 MFC r257946:
Introduce seperate mutex lock to protect protect CTL I/O pools, slightly
reducing global CTL lock scope and congestion.

While there, simplify CTL I/O pools KPI, hiding implementation details.
2014-01-09 10:59:31 +00:00
mav
2886802896 MFC r256995:
Remove 128KB bzero() call done for every block I/O data buffer.
2014-01-09 10:50:20 +00:00
mav
2e2af5808b MFC r256547 (by smh):
Added 4K quirks for Corsair Neutron GTX SSD's
2014-01-09 10:49:14 +00:00
mav
211b1cf423 MFC r259197:
Do not DELAY() for P-state transition unless we want to see the result.

Intel manual says: "If a transition is already in progress, transition to
a new value will subsequently take effect. Reads of IA32_PERF_CTL determine
the last targeted operating point."  So seems it should be fine to just
trigger wanted transition and go.  Linux does the same.
2014-01-09 10:44:27 +00:00
kib
dd0e0d7345 MFC r260205:
Update the description for pmap_remove_pages() to match the modern
times.  Assert that the pmap passed to pmap_remove_pages() is only
active on current CPU.
2014-01-09 03:32:03 +00:00
kib
a3d28139be MFC r260204:
Assert that accounting for the pmap resident pages does not underflow.
2014-01-09 03:24:36 +00:00
pfg
e22a9135f1 MFC r259873:
gcc: small enhancements for the arm support.

fixes GCC-PR target/31152

Obtained from:	gcc 4.3 (rev. r118461, 125973: GPLv2)
2014-01-08 19:33:16 +00:00
peter
aa3916c7c0 Revert MFC of r258821 - it was already handled by MFC of r239672.
Pointy hat to: peter
2014-01-08 03:16:21 +00:00
cperciva
5190528326 MFC r258893, r258956:
Add a new sysctl / loader tunable kern.panic_reboot_wait_time which
  defaults to PANIC_REBOOT_WAIT_TIME (a long-existing kernel config
  setting).  Use this now-variable value in place of the defined constant
  to control how long the system waits after a panic before rebooting.
2014-01-08 02:19:39 +00:00
tuexen
c4f2c365c9 MFC r260257:
Fix several bugs in sctp_bindx():
* Set errno to EAFNOSUPPORT if an address is provided which is neither
  AF_INET nor AF_INET6.
* Don't modify the arguments.
* Don't smash the stack when provided with a non-zero port.
* Handle the case correctly where the first address provided is
  an IPv6 address.
2014-01-07 23:51:41 +00:00
tuexen
624cda0839 MFC r259943:
Address some warnings which showed up on the userland version.
2014-01-07 23:50:02 +00:00
peter
16f467cacd MFC r258821 - fix tcp simultaneous close
PR:		kern/99188
2014-01-07 23:00:58 +00:00
edavis
be72cc4373 Merged r260415 from head.
Approved by:	davidch
2014-01-07 22:59:33 +00:00
trociny
5eee015d1e MFC r260049:
Add mibs for hastd(1) queue stats.
2014-01-07 21:23:41 +00:00
delphij
78c318112b MFC r260403 (MFV r260399):
Apply vendor commits:

197e0ea	Fix for TLS record tampering bug.  (CVE-2013-4353).
3462896	For DTLS we might need to retransmit messages from the
	previous session so keep a copy of write context in DTLS
	retransmission buffers instead of replacing it after
	sending CCS.  (CVE-2013-6450).
ca98926 When deciding whether to use TLS 1.2 PRF and record hash
	algorithms use the version number in the corresponding
	SSL_METHOD structure instead of the SSL structure.  The
	SSL structure version is sometimes inaccurate.
	Note: OpenSSL 1.0.2 and later effectively do this already.
	(CVE-2013-6449).

Security:	CVE-2013-4353
Security:	CVE-2013-6449
Security:	CVE-2013-6450
2014-01-07 20:04:41 +00:00
pjd
9a40d227b3 MFC r260290:
Bring back the old size of the kinfo_file structure to preserve ABI.
Keep only one uint64_t spare for further cap_rights_t expension.

Add a comment clarifying that if the size of this structure changes,
a new sysctl MIB has to be allocate for it and the old structure has
to be returned by the old sysctl MIB.

Requested by:   re
2014-01-07 19:46:17 +00:00
mjg
759bcf6814 MFC r260232:
Don't check for fd limits in fdgrowtable_exp.

Callers do that already and additional check races with process
decreasing limits and can result in not growing the table at all, which
is currently not handled.
2014-01-07 19:28:10 +00:00
pfg
daf195b13f MFC r259841
gcc:  Add ability to generate DWARF pubtypes section if
DEBUG_PUBTYPES_SECTION is defined.

Obtained from:	gcc 4.3 (rev. 118826; GPLv2)
2014-01-07 18:32:31 +00:00
scottl
cd4455d638 MFC Alexander Motin's direct dispatch, multi-queue, and finer-grained
locking support for CAM

r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.

r256836:
Remove hard limit on number of BIOs handled with one ATA TRIM request.

r256843:
Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

r256888:
Unconditionally acquire periph reference on CCB allocation failure.

r256895:
Fix memory and references leak due to unfreed path.

r256960:
Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
This fixes race condition with cam_periph_ccbwait(), causing use-after-free.

r256975:
Minor (mostly cosmetical) addition to r256960.

r257054:
Some microoptimizations for da and ada drivers:
 - Replace ordered_tag_count counter with single flag;
 - From da remove outstanding_cmds counter, duplicating pending_ccbs list;
 - From da_softc remove unused links field.

r257482:
Fix lock recursion, triggered by `smartctl -a /dev/adaX`.

r257501:
Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment.  getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.

r257914:
Some CAM locks polishing:
 - Fix LOR and possible lock recursion when handling high-power commands.
Introduce new lock to protect left power quota and list of frozen devices.
 - Correct locking around xpt periph creation.
 - Remove seems never used XPT_FLAG_OPEN xpt periph flag.

Again, Netflix assisted with testing the merge, but all of the credit goes
to Alexander and iX Systems.

Submitted by:	mav
Sponsored by:	iX Systems
2014-01-07 01:51:48 +00:00
scottl
0a34594b9c MFC Alexander Motin's GEOM direct dispatch work:
r256603:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time.  Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

r256607:
Fix passing uninitialized bio_resid argument to g_trace().

r256610:
Add unmapped I/O support to GEOM RAID.

r256830:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer.  That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

r256880:
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

r259247:
Fix bug introduced at r256607.  We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Testing of the stable/10 merge was done by Netflix, but all of the credit
goes to Alexander and iX Systems.

Submitted by:   mav
Sponsored by:   iX Systems
2014-01-07 01:32:23 +00:00
mav
1bce546983 MFC r256885:
Remove global device lock acquisition from dev_relthread(), replacing it
with atomics on per-device data.
2014-01-05 23:02:03 +00:00
mav
4fb4fef0e1 MFC r256614:
- Take BIO lock in biodone() only when there is no completion callback set
and so we should wake up thread waiting in biowait().
 - Remove msleep() timeout from biowait().  It was added 11 years ago, when
there was no locks used, and it should not be needed any more.
2014-01-05 23:00:38 +00:00
mav
3dd7b80d9a MFC r258173:
Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal.
2014-01-05 22:55:21 +00:00