198393 Commits

Author SHA1 Message Date
kib
de8b80a46a MFC r279367:
Fix typo.
2015-03-02 09:15:50 +00:00
ae
4cbe57cef8 MFC r279206:
In some cases soreceive_dgram() can return no data, but has control
  message. This can happen when application is sending packets too big
  for the path MTU and recvmsg() will return zero (indicating no data)
  but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU.
  Remove KASSERT() which does NULL pointer dereference in such case.
  Also call m_freem() only when m isn't NULL.

MFC r279209:
  soreceive_generic() still has similar KASSERT(), therefore instead of
  remove KASSERT(), change it to check mbuf isn't NULL.

PR:		197882
Sponsored by:	Yandex LLC
2015-03-02 07:51:14 +00:00
ngie
06e10c673b Regen src.conf(5) 2015-03-01 22:12:24 +00:00
ngie
0625beb8de MFC r278193:
Add MK_FILE to control whether or not to build file(1), libmagic(3), etc

Sponsored by: EMC / Isilon Storage Division
2015-03-01 22:07:54 +00:00
ngie
de8fb43ec9 MFC r278192:
Add the following options to enable/disable several features in the base system

WITHOUT_BOOTPARAMD - bootparamd
WITHOUT_BOOTPD - bootpd
WITHOUT_FINGER - finger, fingerd
WITHOUT_FTP - ftp, ftpd
WITHOUT_INETD - inetd
WITHOUT_RBOOTD - rbootd
WITHOUT_TCP_WRAPPERS - tcpd, et al
WITHOUT_TFTP - tftp, tftp-server
WITHOUT_TIMED - timed

Sponsored by: EMC / Isilon Storage Division
2015-03-01 22:03:52 +00:00
ngie
9da1add171 MFC r278704:
Unbreak rcorder when MK_UNBOUND == no by moving local_unbound from REQUIRE:
in NETWORKING to BEFORE: in the script
2015-03-01 21:24:19 +00:00
ngie
e298a3e09f Unbreak rcorUnbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to
BEFORE: in utx
2015-03-01 21:22:34 +00:00
ngie
b4b5cbeab3 MFC r278891:
Add the mnt_lockref field to the ddb(4) 'show mount' command

Differential Revision: https://reviews.freebsd.org/D1688
Submitted by: Conrad Meyer <conrad.meyer@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2015-03-01 21:03:34 +00:00
kib
76ac5da69f MFC r276949:
(only to ease merging of r279117).

MFC r279117:
Revert r276949 and redo the fix for PCIe/PCI bridges, which do not
follow specification and do not provide PCIe capability.
2015-03-01 10:39:19 +00:00
kib
861937e4a4 MFC r276948:
Print rid when announcing DMAR context creation.  Print sid when fault
occurs.
2015-03-01 10:35:54 +00:00
kib
28c8a09abb MFC r276867:
Fix DMAR context allocations for the devices behind PCIe->PCI bridges
after dmar driver was converted to use rids.  The bus component to
calculate context page must be taken from the requestor rid, which is
a bridge, and not from the device bus number.
2015-03-01 10:29:48 +00:00
mav
8882db8870 MFC r279276: Add checks for malloc() failures.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-01 09:29:59 +00:00
mav
47c76cda56 MFC r279277: Fix memory leak on incorrect initiator portal.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-01 09:28:39 +00:00
rstone
a206bae4b5 MFC r277649:
vmspace_release() may sleep if the last reference is being released,
   so add a WITNESS_WARN() to catch cases where it is called with a
   non-sleepable lock held.

   MFC after:    1 month
   Sponsored by: Sandvine Inc.
2015-03-01 04:39:07 +00:00
rstone
6d2b81bc2b MFC r272284
Fix integer truncation in affecting systat -ifstat

   The "systat -ifstat" command was using a u_int to store byte counters.
   With a 10Gbps or faster interface, this overflows within the default
   5 second refresh period.  Switch to using a uint64_t across the board,
   which matches the size used for all counters as of r263102.

   PR:           182448
   MFC after:    1 week
   Sponsored by: Sandvine Inc
2015-03-01 04:36:20 +00:00
rstone
4d61816598 MFC r265107
Be consistent with the whitespace in the rest of these files.

   X-MFC-With: r264007
2015-03-01 04:28:30 +00:00
rstone
d495e9b4cf MFC r264091
Correct a PCI enumeration bug introduced in r264011

   Ensure that first_func is set to 0 on every iteration of the PCI slot
   enumeration loop after the first.  There is a continue statement that would
   cause first_func to stay at 1 any PCI device where slot 0 has no functions
   until we find a slot that does have a function.  This would cause us to
   not enumerate the first PCI function on the device.

   Credit to markj@ for spotting the bug.

   X-MFC-With: r264011
2015-03-01 04:26:47 +00:00
rstone
0b55a8c80a MFC r264007,r264008,r264009,r264011,r264012,r264013
MFC support for PCI Alternate RID Interpretation.  ARI is an optional PCIe
feature that allows PCI devices to present up to 256 functions on a bus.
This is effectively a prerequisite for PCI SR-IOV support.

r264007:
   Add a method to get the PCI RID for a device.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264008:
   Re-implement the DMAR I/O MMU code in terms of PCI RIDs

   Under the hood the VT-d spec is really implemented in terms of
   PCI RIDs instead of bus/slot/function, even though the spec makes
   pains to convert back to bus/slot/function in examples.  However
   working with bus/slot/function is not correct when PCI ARI is
   in use, so convert to using RIDs in most cases.  bus/slot/function
   will only be used when reporting errors to a user.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264009:
   Re-write bhyve's I/O MMU handling in terms of PCI RID.

   Reviewed by:  neel
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264011:
   Add support for PCIe ARI

   PCIe Alternate RID Interpretation (ARI) is an optional feature that
   allows devices to have up to 256 different functions.  It is
   implemented by always setting the PCI slot number to 0 and
   re-purposing the 5 bits used to encode the slot number to instead
   contain the function number.  Combined with the original 3 bits
   allocated for the function number, this allows for 256 functions.

   This is enabled by default, but it's expected to be a no-op on currently
   supported hardware.  It's a prerequisite for supporting PCI SR-IOV, and
   I want the ARI support to go in early to help shake out any bugs in it.
   ARI can be disabled by setting the tunable hw.pci.enable_ari=0.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264012:
   Print status of ARI capability in pciconf -c

   Teach pciconf how to print out the status (enabled/disabled) of the ARI
   capability on PCI Root Complexes and Downstream Ports.

   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264013:
   Add missing copyright date.

   MFC after:    2 months
2015-03-01 04:22:06 +00:00
dim
058f9df187 MFC r279312:
Fix a number of -Wcast-qual warnings under sys/arm.  No functional
change.

Submitted by:	andrew
2015-03-01 01:08:14 +00:00
dim
d160004487 MFC r279311:
In sys/arm/ti/am335x/am335x_rtc.c, fix a clang 3.6.0 warning about
am33x_rtc_softc::sc_irq_res (which is an array) never being NULL.

Submitted by:	andrew
2015-03-01 00:57:01 +00:00
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