198239 Commits

Author SHA1 Message Date
ngie
4b0ec0fcb8 MFC r277740,r278053:
r277740:

  Honor MK_WIRELESS with etc/rc.d/hostapd and etc/rc.d/wpa_supplicant

  Sponsored by: EMC / Isilon Storage Division

r278053:

  Remove hostapd and wpa_supplicant from FILES so they're installed conditionally
  if MK_WIRELESS != no
2015-02-05 09:59:18 +00:00
scottl
87b6a908d9 MFC 277717:
Fix the ioctl interface to properly support fetching the header of regular
and extended config pages.

Obtained from:	Netflix, Inc.
2015-02-05 09:29:57 +00:00
ngie
6cbea0fc89 MFC r277733:
r277733:

  Honor MK_AMD with etc/rc.d/amd

  Sponsored by: EMC / Isilon Storage Division
2015-02-04 09:33:42 +00:00
ngie
152cd06f53 MFC r277732:
r277732:

  Honor MK_API in etc/rc.d

  Sponsored by: EMC / Isilon Storage Division
2015-02-04 09:31:10 +00:00
ngie
5f6c6cdef0 MFC r277731,r277734:
r277731:

  Honor MK_LPR with etc/rc.d/lpd

  Sponsored by: EMC / Isilon Storage Division

r277734:

  Remove explicit inclusion of lpd from FILES

  Sponsored by: EMC / Isilon Storage Division
2015-02-04 09:21:07 +00:00
ngie
4387ccbff5 MFC r277738:
r277738:

  Honor MK_BLUETOOTH with etc/defaults/bluetooth.device.conf

  Sponsored by: EMC / Isilon Storage Division
2015-02-04 09:14:07 +00:00
ngie
50ffbe800b MFC r277739:
r277739:

  Honor MK_JAIL with etc/rc.d/jail

  Sponsored by: EMC / Isilon Storage Division
2015-02-04 09:10:46 +00:00
delphij
250dcf712f MFC r276571: Add a manual page for phttpget(8). 2015-02-04 00:56:55 +00:00
delphij
c2a80f71df MFC r277433: MFV r277432:
Plug various memory leaks in libzfs import implementation.

Illumos issue:
    5518 Memory leaks in libzfs import implementation
2015-02-04 00:51:50 +00:00
delphij
4022cf7d2e MFC r277463:
Fix xz handling for files larger than 32K.

Submitted by:	Stefan Ehmann <shoesoft gmx net>
PR:		bin/186861
2015-02-04 00:45:02 +00:00
gjb
cb1ae98039 MFC r277837, r277838:
r277837:
  Provide a description for the 'tests.txz' distribution
  in the MANIFEST file.

  Turn off the test suite installation by default.

 r277838:
  Fix a typo in a comment.

Sponsored by:	The FreeBSD Foundation
2015-02-04 00:34:12 +00:00
ken
75c5e5b66c MFC isp(4) driver changes:
r276839, r276842, r277513, r277514, r277515

  ------------------------------------------------------------------------
  r276839 | ken | 2015-01-08 10:41:28 -0700 (Thu, 08 Jan 2015) | 49 lines

  Fix Fibre Channel Command Reference Number handling in the isp(4) driver.

  The Command Reference Number is used for precise delivery of
  commands, and is part of the FC-Tape functionality set.  (This is
  only enabled for devices that support precise delivery of commands.)
  It is an 8-bit unsigned number that increments from 1 to 255.  The
  commands sent by the initiator must be processed by the target in
  CRN order if the CRN is non-zero.

  There are certain scenarios where the Command Reference Number
  sequence needs to be reset.  When the target is power cycled, for
  instance, the initiator needs to reset the CRN to 1.  The initiator
  will know this because it will see a LIP (when directly connected)
  or get a logout/login event (when connected to a switch).

  The isp(4) driver was not resetting the CRN when a target
  went away and came back.  When it saw the target again after a
  power cycle, it would continue the CRN sequence where it left off.
  The target would ignore the command because the CRN sequence is
  supposed to be reset to 1 after a power cycle or other similar
  event.

  The symptom that the user would see is that there would be lots of
  aborted INQUIRY commands after a tape library was power cycled, and
  the library would fail to probe.  The INQUIRY commands were being
  ignored by the tape drive due to the CRN issue mentioned above.

  isp_freebsd.c:
  	Add a new function, isp_fcp_reset_crn().  This will reset
  	all of the CRNs for a given port, or the CRNs for all LUNs
  	on a target.

  	Reset the CRNs for all targets on a port when we get a LIP,
  	loop reset, or loop down event.

  	Reset the CRN for a particular target when it arrives, is changed
  	or departs.  This is less precise behavior than the
  	clearing behavior specified in the FCP-4 spec (which says
  	that it should be reset for PRLI, PRLO, PLOGI and LOGO),
  	but this is the level of information we have here.  If this
  	is insufficient, then we will need to add more precise
  	notification from the lower level isp(4) code.

  isp_freebsd.h:
  	Add a prototype for isp_fcp_reset_crn().

  Sponsored by:	Spectra Logic
  MFC after:	1 week

  ------------------------------------------------------------------------
  r276842 | ken | 2015-01-08 10:51:12 -0700 (Thu, 08 Jan 2015) | 44 lines

  Close a race in the isp(4) driver that caused devices to disappear
  and not automatically come back if they were gone for a short
  period of time.

  The isp(4) driver has a 30 second gone device timer that gets
  activated whenever a device goes away.  If the device comes back
  before the timer expires, we don't send a notification to CAM that
  it has gone away.  If, however, there is a command sent to the
  device while it is gone and before it comes back, the isp(4) driver
  sends the command back with CAM_SEL_TIMEOUT status.

  CAM responds to the CAM_SEL_TIMEOUT status by removing the device.
  In the case where a device comes back within the 30 second gone
  device timer window, though, we weren't telling CAM the device
  came back.

  So, fix this by tracking whether we have told CAM the device is
  gone, and if we have, send a rescan if it comes back within the 30
  second window.

  ispvar.h:
  	In the fcportdb_t structure, add a new bitfield,
  	reported_gone.  This gets set whenever we return a command
  	with CAM_SEL_TIMEOUT status on a Fibre Channel device.

  isp_freebsd.c:
  	In isp_done(), if we're sending CAM_SEL_TIMEOUT for for a
  	command sent to a FC device, set the reported_gone bit.

  	In isp_async(), in the ISPASYNC_DEV_STAYED case, rescan the
  	device in question if it is mapped to a target ID and has
  	been reported gone.

  	In isp_make_here(), take a port database entry argument,
  	and clear the reported_gone bit when we send a rescan to
  	CAM.

  	In isp_make_gone(), take a port database entry as an
  	argument, and set the reported_gone bit when we send an
  	async event telling CAM consumers that the device is gone.

  Sponsored by:	Spectra Logic
  MFC after:	1 week

  ------------------------------------------------------------------------
  r277514 | will | 2015-01-21 13:27:11 -0700 (Wed, 21 Jan 2015) | 18 lines

  Force commit to record the correct log for r277513.

  If the user sends an XPT_RESET_DEV CCB, make sure to reset the
  Fibre Channel Command Reference Number if we're running on a FC
  controller.

  We send a SCSI Target Reset when we get this CCB, and as a result
  need to reset the CRN to 1 on the next command.

  isp_freebsd.c:
  	In the XPT_RESET_DEV implementation in isp_action(), reset
  	the CRN if we're on a FC controller.

  Submitted by:	ken
  MFC after:	1 week
  Sponsored by:	Spectra Logic
  MFSpectraBSD:	1112787 on 2015/01/15

  ------------------------------------------------------------------------
  r277515 | will | 2015-01-21 13:32:36 -0700 (Wed, 21 Jan 2015) | 25 lines

  Fix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards.

  The newer boards don't have the response field that indicates
  whether the SCSI status byte is present.  You have to just look to
  see whether it is non-zero.

  The code was looking to see whether the sense length was valid
  before propagating the SCSI status byte (and sense information) up
  the stack.  With a status like Reservation Conflict, there is no
  sense information, only the SCSI status byte.  So it wasn't getting
  correctly returned.

  isp.c:
  	In isp_intr(), if we are on a 2400 or 2500 type board and
  	get a response, look at the actual contents of the
  	SCSI status value and set the RQSF_GOT_STATUS flag
  	accordingly so that return any SCSI status value we get.  The
  	RQSF_GOT_SENSE flag will get set later on if there is
  	actual sense information returned.

  Submitted by:	ken
  MFC after:	1 week
  Sponsored by:	Spectra Logic
  MFSpectraBSD:	1112791 on 2015/01/15

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
2015-02-03 22:49:12 +00:00
ken
d2ea45e16c MFC r276835:
r276835 | ken | 2015-01-08 09:58:40 -0700 (Thu, 08 Jan 2015) | 91 lines

  Improve camcontrol(8) handling of drive defect data.

  This includes a new summary mode (-s) for camcontrol defects that
  quickly tells the user the most important thing: how many defects
  are in the requested list.  The actual location of the defects is
  less important.

  Modern drives frequently have more than the 8191 defects that can
  be reported by the READ DEFECT DATA (10) command.  If they don't
  have that many grown defects, they certainly have more than 8191
  defects in the primary (i.e. factory) defect list.

  The READ DEFECT DATA (12) command allows for longer parameter
  lists, as well as indexing into the list of defects, and so allows
  reporting many more defects.

  This has been tested with HGST drives and Seagate drives, but
  does not fully work with Seagate drives.  Once I have a Seagate
  spec I may be able to determine whether it is possible to make it
  work with Seagate drives.

  scsi_da.h:	Add a definition for the new long block defect
  		format.

  		Add bit and mask definitions for the new extended
  		physical sector and bytes from index defect
  		formats.

  		Add a prototype for the new scsi_read_defects() CDB
  		building function.

  scsi_da.c:	Add a new scsi_read_defects() CDB building function.
  		camcontrol(8) was previously composing CDBs manually.
  		This is long overdue.

  camcontrol.c:	Revamp the camcontrol defects subcommand.  We now
  		go through multiple stages in trying to get defect
  		data off the drive while avoiding various drive
  		firmware quirks.

  		We start off by requesting the defect header with
  		the 10 byte command.  If we're in summary mode (-s)
  		and the drive reports fewer defects than can be
  		represented in the 10 byte header, we're done.
  		Otherwise, we know that we need to issue the
  		12 byte command if the drive reports the maximum
  		number of defects.

  		If we're in summary mode, we're done if we get a
  		good response back when asking for the 12 byte header.

  		If the user has asked for the full list, then we
  		use the address descriptor index field in the 12
  		byte CDB to step through the list in 64K chunks.
  		64K is small enough to work with most any ancient
  		or modern SCSI controller.

  		Add support for printing the new long block defect
  		format, as well as the extended physical sector and
  		bytes from index formats.  I don't have any drives
  		that support the new formats.

  		Add a hexadecimal output format that can be turned
  		on with -X.

  		Add a quiet mode (-q) that can be turned on with
  		the summary mode (-s) to just print out a number.

  		Revamp the error detection and recovery code for
  		the defects command to work with HGST drives.

  		Call the new scsi_read_defects() CDB building
  		function instead of rolling the CDB ourselves.

  		Pay attention to the residual from the defect list
  		request when printing it out, so we don't run off
  		the end of the list.

  		Use the new scsi_nv library routines to convert
  		from strings to numbers and back.

  camcontrol.8:	Document the new defect formats (longblock, extbfi,
  		extphys) and command line options (-q, -s, -S and
  		-X) for the defects subcommand.

  		Explain a little more about what drives generally
  		do and don't support.

Sponsored by:	Spectra Logic
2015-02-03 22:18:48 +00:00
ken
100a976c46 MFC 276831:
r276831 | ken | 2015-01-08 09:27:56 -0700 (Thu, 08 Jan 2015) | 30 lines

  Fix a bug in the CAM SCSI probe code that caused changes in inquiry
  data to go undetected.

  The probe code does an MD5 checksum of the inquiry data (and page
  0x80 serial number if available) before doing a reprobe of an
  existing device, and then compares a checksum after the probe to
  see whether the device has changed.

  This check was broken in January, 2000 by change 56146 when the extended
  inquiry probe code was added.

  In the extended inquiry probe case, it was calculating the checksum
  a second time.  The second time it included the updated inquiry
  data from the short inquiry probe (first 36 bytes).  So it wouldn't
  catch cases where the vendor, product, revision, etc. changed.

  This change will have the effect that when a device's inquiry data is
  updated and a rescan is issued, it will disappear and then reappear.
  This is the appropriate action, because if the inquiry data or serial
  number changes, it is either a different device or the device
  configuration may have changed significantly.  (e.g. with updated
  firmware.)

  scsi_xpt.c:	Don't calculate the initial MD5 checksum on
  		standard inquiry data and the page 0x80 serial
  		number if we have already calculated it.

Sponsored by:	Spectra Logic
2015-02-03 21:54:59 +00:00
hiren
38ccc08c23 MFC r277202
ntpd tries to bind to IPv6 interfaces in 'tentative' state and fails as IPv6 is
actually disabled. Fix it by making ntpd ignore such interfaces.
2015-02-03 20:08:05 +00:00
emaste
64562d8152 Define SHT_GNU_LIBLIST and R_MIPS_64
MFC of r260793
2015-02-03 15:35:58 +00:00
pfg
c215a1c7d8 MFV r277814, r277868, r277869:
amd: Add extra check for NULL before deref.

MFV	r277841:
Fix a clang 3.6.0 warning (from dim)

CID:		274421
Obtained from:	NetBSD
MFC after:	4 days
2015-02-03 14:36:48 +00:00
kib
5e5b664385 MFC r277794:
The sys_quotactl() contract demands that the mount point is
vfs_unbusy()ed when the cmd is Q_QUOTAON, regardless of other input
parameters or error return.
2015-02-03 11:54:33 +00:00
kib
d4cd0639f3 MFC r277793:
Rewrite pmap_enter(9) man page.
2015-02-03 11:45:01 +00:00
mav
683ce518a8 MFC r277419:
Allow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space().

dsl_dir_transfer_space() is mostly called after dsl_dir_diduse_space(),
which already calls dmu_buf_will_dirty() for the same dbuf and tx, so
its duplicate call in those cases will change nothing, only spend time.

Skipping this call by four times reduces time spent in dbuf_write_done()
and descendants, updating dataset statistics with several congested lock
acquisitions.  When rewriting 8K zvol blocks at 1GB/s rate, this reduces
CPU time spent inside dbuf_write_done(), according to profiling, from 45%
of 683K samples to 18% of 422K.
2015-02-03 08:06:13 +00:00
dim
d98d4221ce MFC r277952:
Fix a -Wcast-qual warning in udf_vnops.c, by using __DECONST.  No
functional change.
2015-02-03 08:03:19 +00:00
dim
43997c3f03 MFC r277951:
Fix a bunch of -Wcast-qual warnings in netgraph's ng_parse.c, by using
__DECONST.  No functional change.
2015-02-03 07:59:33 +00:00
nwhitehorn
f1bce3cd64 MFC r277792:
Fix bug in mapppings of multiple pages exposed by updates to the VSCSI
support in QEMU. Each page of a many page mapping was getting mapped to
the same physical address, which is not the desired behavior.
2015-02-03 00:29:58 +00:00
delphij
00fdf5663a MFC r277806:
Use unsigned int for index value.

Without this change a local attacker could trigger a panic by
tricking the kernel into accessing undefined kernel memory.

We would like to acknowledge Francisco Falcon from CORE Security
Technologies who discovered the issue and reported to the
FreeBSD Security Team.

More information can be found at CORE Security's advisory at:
http://www.coresecurity.com/content/freebsd-kernel-multiple-vulnerabilities

This is an errata candidate for releng/10.1 and releng/9.3.  Earlier
releases are not affected.

Reported by:  Francisco Falcon from CORE Security Technologies
Security:     CVE-2014-0998
Reviewed by:  dumbbell
2015-02-02 18:48:49 +00:00
pfg
c6be6095bb MFC r277354, r277365:
ext2: Garbage-collect some unused variables

Reported by:	clang static analysis
2015-02-02 15:52:11 +00:00
loos
ba803d12f9 MFC r277042:
Add support to turn off Beaglebone with poweroff(8) or shutdown(8) -p.

To cut off the power we need to start the shutdown sequence by writing
the OFF bit on PMIC.

Once the PMIC is programmed the SoC needs to toggle the PMIC_PWR_ENABLE
pin when it is ready for the PMIC to cut off the power.  This is done by
triggering the ALARM2 interrupt on SoC RTC.

The RTC driver only works in power management mode which means it won't
provide any kind of time keeping functionality.  It only implements a way
to trigger the ALARM2 interrupt when requested.
2015-02-02 12:48:13 +00:00
loos
49286c2a50 MFC r261459, r273045, r273047.
r261459:
Remove trailing tabs causing false grep positives.

r273045:
Sort the files in the am355x directory.

r273047:
Remove the need for files.beaglebone and std.beaglebone by moving the one
option they defined into files.am335x.
2015-02-02 12:36:05 +00:00
mav
900f0a33cf MFC r277758: Fix several potential overflows in UNMAP code. 2015-02-02 12:09:42 +00:00
loos
6ca887b620 MFC r276751:
Remove the check that prevent carp(4) advskew to be set to '0'.

CARP devices are created with advskew set to '0' and once you set it to
any other value in the valid range (0..254) you can't set it back to zero.

The code in question is also used to prevent that zeroed values overwrite
the CARP defaults when a new CARP device is created.  Since advskew already
defaults to '0' for newly created devices and the new value is guaranteed
to be within the valid range, it is safe to overwrite it here.

PR:		194672
Reported by:	cmb@pfsense.org
2015-02-02 11:42:35 +00:00
loos
d3f0aee2c6 MFC r277208:
Fix the PMIC node name to match the PMIC i2c address.

Remove an extra blank line.

No functional changes.
2015-02-02 11:26:52 +00:00
loos
e340772cb9 MFC r277206:
Catch a few cases where we need to release memory resources on errors.

Place parentheses around variables in macros.
2015-02-02 11:12:31 +00:00
ngie
22af0668e8 MFC r277686,r277687:
r277686:

  Install bsnmp rc.d script if MK_BSNMP != no

  Sponsored by: EMC / Isilon Storage Division

r277687:

  Fill in entries for MK_BSNMP == no

  Sponsored by: EMC / Isilon Storage Division
2015-02-02 09:56:57 +00:00
ngie
99d3fdc9f3 MFC r277541:
r277541:

  Add sample log rotation support for opensm

  Up to 7 archives of the log will be kept (just for consistency with the other
  log rotation rules)

  PR: 196788
  Reviewed by: hselasky
  Sponsored by: EMC / Isilon Storage Division
2015-02-02 09:24:40 +00:00
ngie
91a6a3651f MFC r277685:
r277685:

  Fill in some dtrace entries when MK_CDDL == no

  Sponsored by: EMC / Isilon Storage Division
2015-02-02 08:53:45 +00:00
dim
2071e2cb3e MFC r277901:
Fix a -Wcast-qual warning in libkern's strtol(), by using __DECONST.  No
functional change.

MFC r277903:

Similar to r277901, fix more -Wcast-qual warnings in libkern's strtoq(),
strtoul() and strtouq(), by using __DECONST.  No functional change.
2015-02-02 08:05:11 +00:00
dim
c01327573e MFC r277899:
Fix a bunch of -Wcast-qual warnings in cd9660_util.c, by using
__DECONST.  No functional change.
2015-02-02 07:42:03 +00:00
dim
3541d65302 MFC r277898:
Fix a bunch of -Wcast-qual warnings in msdosfs_conv.c, by using
__DECONST.  No functional change.
2015-02-02 07:37:25 +00:00
dim
c38e60c109 MFC r277883:
Ensure that lint does not pick up C11 keywords (e.g.  _Noreturn), even
if C11 mode is used.  It does not support any C11 constructs.
2015-02-02 07:30:00 +00:00
ngie
ab0b7c3d85 MFC r277674:
r277674 (by ngie):

  Fix building rcorder with -DDEBUG by using libutil.h instead of util.h from
  usr.bin/make

  Sponsored by: EMC / Isilon Storage Division
2015-02-02 05:46:36 +00:00
ngie
654a0e626a MFC r277666:
r277666 (by ngie):

  Only build share/dtrace if MK_CDDL != no

  Sponsored by: EMC / Isilon Storage Division
2015-02-02 05:44:34 +00:00
ngie
4d8b65cb6d MFC r271892:
r271892 (by ngie):

  Sort the optional rc.d scripts by their knobs

  Sponsored by: EMC / Isilon Storage Division
2015-02-02 05:17:26 +00:00
ngie
736af7d2b8 MFC r277939:
r277939 (by ngie):

  Create MANLINKS for lzgrep, etc when MK_LZMA_SUPPORT != no

  Sponsored by: EMC / Isilon Storage Division
2015-02-02 04:54:43 +00:00
gjb
ae62155522 MFC r262936:
Update board definition for WANDBOARD-QUAD to match crochet.

Sponsored by:	The FreeBSD Foundation
2015-02-02 01:02:49 +00:00
smh
ee75a2f04f MFC r276123:
Always sync the global ZFS config cache to reflect the new mosconfig

MFC r277351:
Clean ZFS spa config before syncing

Sponsored by:	Multiplay
2015-02-01 12:39:40 +00:00
smh
9de77a522d MFC r276027:
Switch zfsboot installer force 4K option to use vfs.zfs.min_auto_ashift=12

MFC r277333:
Fix bsdinstall when working with geli boot disks

Sponsored by:	Multiplay
2015-02-01 12:33:40 +00:00
dim
2ccbfd1b8e Revert r278017 (MFC of r273381 and r276417) and r278018 (MFC of r273434)
until I can figure out why it leads to link failures in some scenarios.
2015-02-01 02:29:58 +00:00
dim
111a0cf771 MFC r273434 (by bapt):
Do not define bad_array_new_length::bad_array_new_length in libc++ anymore
when used in combinaison with libcxxrt since it is now defined there already.
This fixes building world
2015-02-01 01:42:38 +00:00
dim
d55f158aa0 MFC r273381 (by bapt):
Add support for __cxa_throw_bad_array_new_length in libcxxrt

It is required for use with newer g++49

Differential Revision:	https://reviews.freebsd.org/D982
Reviewed by:	theraven
Approved by:	theraven

MFC r276417:

Import libcxxrt master 00bc29eb6513624824a6d7db2ebc768a4216a604.

Interesting fixes:
76584a0  Reorganize code to use only 32bit atomic ops for 32bit platforms
30d2ae5  Implement __cxa_throw_bad_array_new_length

Reviewed by:	bapt
Differential Revision: https://reviews.freebsd.org/D1390
2015-01-31 23:48:59 +00:00
jamie
c6bc15d7ab MFC r277855:
Add allow.mount.fdescfs jail flag.

PR:		192951
Submitted by:	ruben@verweg.com
2015-01-31 17:35:53 +00:00
kib
b397ed48ff MFC r277827:
tmpfs does not use UVM on FreeBSD.
2015-01-31 11:04:41 +00:00