198373 Commits

Author SHA1 Message Date
dim
0611c6ea5b MFC r279307:
Make libcxxrt's parsing of DWARF exception handling tables work on
architectures with strict alignment, by using memcpy() instead of
directly reading fields.

Reported by:	Daisuke Aoyama <aoyama@peach.ne.jp>
Reviewed by:	imp, bapt
Tested by:	bapt
Differential Revision: https://reviews.freebsd.org/D1967

MFC r279310:

Since newer versions of compiler-rt require unwind.h, and we want to use
the copy in libcxxrt for it, fix the arm-specific header to define the
_Unwind_Action type.

Submitted by:	andrew
2015-03-01 00:47:37 +00:00
hselasky
c3632bcc50 MFC r279233:
Ensure that the XHCI driver will refresh the control endpoint settings
when re-enumerating a FULL speed device. Else the wrong max packet
setting might be used when trying to re-enumerate a FULL speed device.
2015-02-27 12:20:03 +00:00
jamie
4e65f612d1 MFC r279083:
Fix the logic for skipping parameters (with -s) that have "jailsys"
  parents (such as host.hostname); these were being skipped all the time.
  That it went this long without anyone noticing is a sign that this feature
  isn't actually used by anyone, but it's there so it might as well work.

MFC r279123:

  Allow for parameters added with the JP_OPT flag to not exist.
  That's why the flag exists in the first place.
2015-02-27 02:53:44 +00:00
jamie
23006cc982 MFC r279081:
Allow parameters listed on the command line to override the -v option,
  instead of crashing.

PR:		197701
2015-02-27 02:50:01 +00:00
ken
a5cd9b061e MFC r278964:
The __FreeBSD_version was changed to 1001510 to be appropriate for
stable/10.

I will followup with a commit to mpr(4) and mps(4) in head to reflect
the stable/10 __FreeBSD_version and merge the change back to stable/10.

  ------------------------------------------------------------------------
  r278964 | ken | 2015-02-18 11:30:19 -0700 (Wed, 18 Feb 2015) | 46 lines

  Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
  properly.

  If there is garbage in the flags field, it can sometimes include a
  set CDAI_FLAG_STORE flag, which may cause either an error or
  perhaps result in overwriting the field that was intended to be
  read.

  sys/cam/cam_ccb.h:
  	Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE,
  	that callers can use to set the flags field when no store
  	is desired.

  sys/cam/scsi/scsi_enc_ses.c:
  	In ses_setphyspath_callback(), explicitly set the
  	XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the
  	physical path information.  Instead of ORing in the
  	CDAI_FLAG_STORE flag when storing the physical path, set
  	the flags field to CDAI_FLAG_STORE.

  sys/cam/scsi/scsi_sa.c:
  	Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when
  	fetching extended inquiry information.

  sys/cam/scsi/scsi_da.c:
  	When storing extended READ CAPACITY information, set the
  	XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of
  	ORing it into a field that isn't initialized.

  sys/dev/mpr/mpr_sas.c,
  sys/dev/mps/mps_sas.c:
  	When fetching extended READ CAPACITY information, set the
  	XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of
  	setting it to 0.

  sbin/camcontrol/camcontrol.c:
  	When fetching a device ID, set the XPT_DEV_ADVINFO flags
  	field to CDAI_FLAG_NONE instead of 0.

  sys/sys/param.h:
  	Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO
  	CCB flag, CDAI_FLAG_NONE.

  Sponsored by:	Spectra Logic
2015-02-26 20:46:16 +00:00
rpaulo
acb7a45ef0 MFC r278933:
Fix a typo in ipv6_down().

  Submitted by:	Ashutosh Kumar AK0037447 at TechMahindra.com
2015-02-26 19:56:48 +00:00
emaste
c01620e952 Implement the -fuse-ld= option.
Merge upstream Clang revision 211785:
  This commit implements the -fuse-ld= option, so that the user
  can specify -fuse-ld=bfd to use ld.bfd.

  This commit re-applies r194328 with some test case changes.
  It seems that r194328 was breaking macosx or mingw build
  because clang can't find ld.bfd or ld.gold in the given sysroot.
  We should use -B to specify the executable search path instead.

  Patch originally by David Chisnall.

This is a direct commit to stable/10 as this is change is already
included in Clang 3.5 in HEAD. The patch is also reworked slightly for
Clang 3.4.1.

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
2015-02-25 22:32:32 +00:00
dim
a98c93ae72 Add clang patches corresponding to r279289. 2015-02-25 17:54:18 +00:00
dim
3ebe79edba Pull in r199571 from upstream clang trunk (by Ted Kremenek):
Harden InitListExpr::isStringLiteralInit() against getInit()
  returning null.

  This led to a crash on invalid code (sorry, no good test case).

  Fixes <rdar://problem/15831804>.

This fixes an assertion when compiling certain incorrect code, as
reported upstream in http://llvm.org/PR22684 .

Direct commit to stable/10 and stable/9, since head has clang 3.5.1,
which already includes this change.

Reported by:	hbowden@securelabsllc.com
2015-02-25 17:27:02 +00:00
gjb
ab185f6ca7 Bump __FreeBSD_version after FreeBSD-EN-15:01.vt,
FreeBSD-EN-15:02.openssl, FreeBSD-EN-15:03.freebsd-update,
FreeBSD-SA-15:04.igmp, FreeBSD-SA-15:05.bind

Sponsored by:	The FreeBSD Foundation
2015-02-25 16:44:40 +00:00
gjb
30ef228521 Document FreeBSD-EN-15:01.vt, FreeBSD-EN-15:02.openssl,
FreeBSD-EN-15:03.freebsd-update, FreeBSD-SA-15:04.igmp,
FreeBSD-SA-15:05.bind

Sponsored by:	The FreeBSD Foundation
2015-02-25 16:36:44 +00:00
hselasky
caa67af5b7 MFC r278850:
Handle VBUS error interrupts.

PR:		190471
2015-02-25 12:24:24 +00:00
mav
0bda5f012c MFC r278584: Add support for General Statistics and Performance log page.
CTL already collects most of statistics reported there, so why not.
2015-02-25 09:21:04 +00:00
kib
61abcd4fb5 MFC r278963:
If malloc() sleeps, Giant is dropped.  Recheck for another thread
doing our work.

Remove unneeded check for failed M_WAITOK allocation.
2015-02-25 09:19:26 +00:00
tijl
8550f17491 MFC r278586:
Fix ldscripts such that ld(1) collects the .fini_array section in the same
order as the .init_array section.  Finalisation routines need to be called
in the opposite order as their corresponding initialisation routines but
rtld(1) handles that by calling the function pointers in .fini_array in
reverse order.

Reviewed by:	kib
2015-02-25 08:39:48 +00:00
delphij
9d303d647b Instant MFC:
Fix integer overflow in IGMP protocol.

Security:	FreeBSD-SA-15:04.igmp
Security:	CVE-2015-1414
Found by:	Mateusz Kocielski, Logicaltrust
Analyzed by:	Marek Kroemeke, Mateusz Kocielski (shm@NetBSD.org) and
		22733db72ab3ed94b5f8a1ffcde850251fe6f466
Submited by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
Reviewed by:	bms
Approved by:	so
2015-02-25 05:43:02 +00:00
marius
41a96ed99b MFC: r278870
Unbreak sparc64 after r276630 (MFCed to stable/10 in r277317) by calling
__sparc_sigtramp_setup signal trampoline as part of the MD __sys_sigaction
again.

Submitted by:	kib (initial versions)
2015-02-24 22:28:44 +00:00
emaste
224ab7ed88 MFC part of r273865: fix boot1.efi for block size != 512
r273865 is part of the work for supporting 4Kn drives, but it turns out
the underlying bug can actually cause corruption of the UEFI system
table in any case where block size is not 512.

Relevant portion of the original commit message:

  convert boot1.efi to corrrectly calculate the lba for what the
  media reports and convert the size based on what FreeBSD uses.
  existing code would use the 512 byte lba and convert the
  using 4K byte size.

PR:		197881
Reviewed by:	Chris Ruffin
2015-02-24 22:11:07 +00:00
kib
9534a4a472 MFC r278523:
In mountd, silence a race with the parallel unmount.
2015-02-24 01:46:43 +00:00
jhb
7b2a7d1b7b MFC 275412:
The runtime linker needs to include a path to itself in the link map
it exports to the debugger.  It currently has two choices: it can use
a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored
in the interpreter path in the binary being executed.  The runtime linker
currently prefers the second.  However, this is usually wrong for compat32
binaries since the binary specifies the path of rtld on a 32-bit system
(/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1).
For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as
the rtld path and ignore the path in the binary for the 32-bit runtime
linker.
2015-02-23 21:16:02 +00:00
jhb
4ee9c49971 MFC 274817,274878,276801,276840,278976:
Improve support for XSAVE with debuggers.
- Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed
  to match what Linux does in that 1) it dumps the entire XSAVE area
  including the fxsave state, and 2) it stashes a copy of the current
  xsave mask in the unused padding between the fxsave state and the
  xstate header at the same location used by Linux.
- Teach readelf() to recognize NT_X86_XSTATE notes.
- Change PT_GET/SETXSTATE to take the entire XSAVE state instead of
  only the extra portion. This avoids having to always make two
  ptrace() calls to get or set the full XSAVE state.
- Add a PT_GET_XSTATE_INFO which returns the length of the current
  XSTATE save area (so the size of the buffer needed for PT_GETXSTATE)
  and the current XSAVE mask (%xcr0).
2015-02-23 18:38:41 +00:00
pluknet
bddd935ed9 MFC r278857:
kdump: sendfile(2) "flags" argument needs casting on 64-bit platforms.

Sponsored by:	Nginx, Inc.
2015-02-23 08:45:42 +00:00
markj
f19f98c27b MFC r278983:
Free the zlib stream once the CTF section is decompressed.

MFC r278984:
Remove unnecessary checks for a NULL return value from malloc.

MFC r279089:
Let vn_rdwr() check for short reads.
2015-02-23 01:24:10 +00:00
kib
6485f99c19 MFC r278871:
Array cannot be NULL, remove always true comparision.
2015-02-23 01:17:45 +00:00
kevlo
8f182b4e4a MFC r278840:
Xref the following in wlan(4):

- rsu(4)
- urtwn(4)
2015-02-22 15:30:08 +00:00
kevlo
8984d8aec3 MFC r277481:
Typo: ivalid -> invalid.
2015-02-22 15:28:49 +00:00
kevlo
3d2c9b77bb MFC r278551:
Add preliminary support for the Ralink RT5390 and RT5392 chipsets.
Committed over the D-Link DWA-525 rev A2 on amd64 with WPA.
2015-02-22 15:27:02 +00:00
pfg
d9009c4721 MFC r278790, r278802:
Initialize the allocation of variables related to the ext2 allocator.

Use malloc to clear the values and initialize e2fs_contigdirs
during allocation.  free() e2fs_contigdirs upon error.

While here clean up small style issues.
2015-02-22 02:14:49 +00:00
pfg
e68df85091 MFC r278791:
Reuse value of cursize instead of recalculating.

Reported by:	Clang static checker
2015-02-22 01:42:45 +00:00
pfg
43c38b5dd3 MFC r278803, r278905:
ulimit(3): Fix broken check.

The existing implementation had a broken comparison that could
overflow and return confusing values.  Replace this with a check
that avoids the overflow before it happens.

Consistently return a maximum value also on the case of negative
arguments since negative is considered an overflow and means
infinity for our current setrlimit().

New revamped version is credited to Bruce Evans.

CID:		1199295
2015-02-22 01:31:28 +00:00
gjb
af525877d1 Update commented last revision.
Sponsored by:	The FreeBSD Foundation
2015-02-20 20:33:43 +00:00
gjb
d7fe3fe354 Add 'Generic Storage' section.
Document r279002, r279055:
 ctld(8) update to control non-iSCSI CTL ports
 CTL LUN mapping rewrite

Sponsored by:	The FreeBSD Foundation
2015-02-20 20:30:04 +00:00
gjb
b60421a369 Document r277583, arc_meta_limit exposed via kstats.
Sponsored by:	The FreeBSD Foundation
2015-02-20 20:30:01 +00:00
gjb
31503f4494 Document r277434, fstyp(8) addition.
Sponsored by:	The FreeBSD Foundation
2015-02-20 20:29:59 +00:00
rpaulo
e7f7550cc0 MFC r278658:
Teach libproc how to find debugging symbols in /usr/lib/debug.
2015-02-20 20:02:47 +00:00
gjb
63bb400ac7 Document r278982, pmc callchain depths increased.
Sponsored by:	The FreeBSD Foundation
2015-02-20 18:06:33 +00:00
mav
466f8525b0 MFC r278594: Add missing asprintf() status checks. 2015-02-20 17:10:46 +00:00
mav
e153ed8e1a MFC r278354: Teach ctld(8) to control non-iSCSI CTL ports.
This change introduces new target option "port", that assigns current target
to specified CTL port.  On config application ctld(8) will apply LUN mapping
according to target configuration to specified port and bring the port up.
On shutdown cltd(8) will remove the mapping and put the port down.

This change allows to configure both iSCSI and FibreChannel targets in the
same configuration file in alike way.

Kernel side support was added earlier at r278037.

Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2015-02-20 17:09:49 +00:00
mav
441b67d0c3 MFC r278311: Some NetGraph debug polishing.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-02-20 11:52:46 +00:00
kib
388f6686df MFC r278889:
Restore the extern qualifier on __cleanup.
2015-02-20 09:25:13 +00:00
hselasky
d1390f9229 MFC r278856:
The "frag_info" pointer is already pointing to an array index.
Don't index twice.

Sponsored by:	Mellanox Technologies
2015-02-19 17:42:12 +00:00
pfg
34ee297366 MFC r278301, r278315:
tdelete(3): don't delete the node we are about to return.

CID:		272528
Obtained from:	NetBSD (CVS rev. 1.4)
2015-02-19 16:24:27 +00:00
pfg
dd4c641aac MFC r278300, r278314:
getdiskbyname(): plug resource leak

Variable cq going out of scope leaks the storage it points to.

CID:		270511
Phabric:	D1775
Reviewed by:	imp
Obtained from:	NetBSD (CVS rev. 1.34)
2015-02-19 16:17:44 +00:00
mav
fa723dd3f0 MFC r278322: Add support for multiple portal groups per target.
This change allows multiple "portal-group" options to be specified per
target.  Each of them may include new optional auth-group name parameter
to override per-target auth parameters for specific portal group.

Kernel side support was added earlier at r278161.

Sponsored by:	iXsystems, Inc.
2015-02-19 14:52:01 +00:00
mav
8667ca9eb4 MFC r278672: Teach CTL to ask GEOM devices about BIO_DELETE support. 2015-02-19 14:40:50 +00:00
mav
8f6eba03a8 MFC r278625: Make XCOPY and WUT commands respect physical block size/offset.
This change by 2-3 times improves performance of misaligned XCOPY and WUT
commands by avoiding unneeded read-modify-write cycles inside ZFS.
2015-02-19 14:36:03 +00:00
mav
2116079c78 MFC r278161: Bring some more order into iSCSI portal group tags support.
While ctld(8) still does not allow multiple portal groups per target
to be configured, kernel should now be able to handle it.

Sponsored by:	iXsystems, Inc.
2015-02-19 14:33:46 +00:00
mav
aa6a7df89f MFC r278037: CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports.  By default all ports are created without LUN mapping, exposing all
CTL LUNs as before.  But, if needed, LUN mapping can be manually set on
per-port basis via ctladm.  For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.

Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition.  LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed.  It
allows same LUN to be exposed several times via multiple targets.

While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.

Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2015-02-19 14:31:16 +00:00
mav
31fb601bdc MFC r274853:
For both iSCSI initiator and target increase socket buffer sizes before
establishing connection.

This is a workaround for Chelsio TOE driver, that does not update socket
buffer size in hardware after connection established, and unless that is
done beforehand, kernel code will stuck, attempting to send/receive full
PDU at once.
2015-02-19 14:28:47 +00:00
mav
4d95d689f3 MFC r274804:
In conf_apply() remove iSCSI ports from kernel before removing LUNs.

Previous order confused initiators with messages about "removed" LUNs
during simple ctld restart without any real config change.  After this
commit initiators only reestablish lost connection, receive "Power on
occurred" UNIT ATTENTION status and continue normal operation.
2015-02-19 14:26:49 +00:00