198365 Commits

Author SHA1 Message Date
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
mav
8fc5fb008d MFC r278619: Make WRITE SAME commands respect physical block size.
This change by 2-3 times improves performance of misaligned WRITE SAME
commands by avoiding unneeded read-modify-write cycles inside ZFS.
2015-02-19 13:06:38 +00:00
kib
01fc097c17 MFC r278627:
Update libthr(3) man page to reflect the work done to support dlopen.
2015-02-19 09:30:42 +00:00
gjb
92782b6e3e MFC r277458, r277536, r277606, r277609, r277836, r277839,
r278118, r278119, r278206, r278502:

 r277458:
  Move virtual machine / cloud provider targets and
  options from release/Makefile to their own Makefile.

  Add glue to allow enabling building cloud provider VM images
  by default.

  Add a 'vm-cloudware' target, used to drive all targets in
  CLOUDTARGETS.

  Add examples for WITH_CLOUDWARE to release.conf.sample.
  Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.

  Rewrite to consolidate VM image build scripts into one.

  Fix duplicated mkimg(1) call in vm_create_disk().

  Add primitive (untested) PowerPC/PowerPC64 VM image support.

  Note: As it is currently written, the /boot/pmbr and
  /boot/{gptboot,boot1.hfs} use the build host and not the
  target build.  Fixing this is likely going to be a hack in
  itself.

  mount(8) and umount(8) devfs(5) as needed.

  Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
  it is consolidated into one file.

  Fix paths for the base image and output disk image files.

  Set the boot partition type to 'apple-boot' for powerpc.

  In vm_install_base(), copy the host resolv.conf into the build
  chroot before attempting to do anything that requires working DNS
  (i.e., pkg bootstrap).

  In vm_extra_pre_umount(), remove the resolv.conf before the disk
  image is unmounted from the backing md(4).

  Silence errors when umounting the chroot's /dev, since it probably
  doesn't exist when we're running this.

  Unmount filesystems before attempting to destroy the md which
  holds them.

  Unmount filesystem and destroy md before we read the vnode from
  disk and package it into a disk image.  Otherwise we end up
  packaging an unclean filesystem.

  Merge duplicative vm-CLOUDTYPE targets before additional duplication
  gets added by the impending arrival of ec2 and gcloud.

  Add NOSWAP option which can be set by a vmimage.conf file to specify
  that no swap space should be created in the image.  This will be used
  by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral"
  disks which are physically attached to the Xen host node.

  In vm_extra_install_packages(), only bootstrap pkg(8) if
  VM_EXTRA_PACKAGES is empty.

  In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
  bootstrapped earlier.

  In vm_extra_install_base(), do not install waagent in the openstack
  image, because it is not used.  This appears to be a copy mistake.

  Remove vm_extra_install_base() from the openstack.conf entirely,
  since it does not need to be overridden.

  Enable password-less sudo for openstack images.

  Update the VM_EXTRA_PACKAGES list for the openstack images.

  Remove vm_extra_install_base() for the Azure image, now that the
  waagent exists in the ports tree.

  Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.

  In vm_extra_pre_umount(), remove the explicit pkg(8) install
  list, as dependencies are resolved by sysutils/azure-agent.

  Add a 'list-cloudware' target to print the list of supported CLOUDWARE
  values and a description.

  Add the AZURE_DESC and OPENSTACK_DESC descriptions.

  Update release(7)

  Add 'list-vmtargets' target, which produces a list of all supported
  VM and cloud provider images.

  Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.

  Update release(7) to document the list-vmtargets target.

  Add initial support for the GCE (Google Compute Engine) cloud hosting
  provider image.

  Remove the console setting from rc.conf(5), which is not used there.
  While here, set console to include vidconsole in the loader.conf(5).

  Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
  function is often overridden.

  Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
  code.

  Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
  belongs.

  The GCE image needs resolv.conf(5) to exist (created as part of the
  image setup), so it cannot be removed.

  Comment the line that configures ttys(5) to 'off', which makes it
  impossible to test that the image boots.

  Add a note explaining why the line is commented, and not (yet) removed
  entirely.

  Move the 'install' bits that are specific to virtual machine images
  from the Makefile to Makefile.vm.

  Rename the 'install' target to 'release-install', and add a new
  'vm-install' target.

  Add a new 'install' target that invokes the new targets.

  Add WITH_CLOUDWARE to the list of make(1) variables for the release
  build.

  Remove hw.vga.textmode=1 from the VM image loader.conf, which was
  included during test builds and not intended to be included when
  merging this project branch back to head.

  Remove mk-azure.sh, which is no longer needed.

 r277536:
  Rename the 'release' target to 'real-release', and add two targets,
  'vm-release' and 'cloudware-release', that are invoked if
  WITH_VMIMAGES and WITH_CLOUDWARE are not empty.

  This fixes an issue where 'make release' would not build the cloud
  provider targets because CLOUDWARE was not yet set.

  Move the WITH_VMIMAGES and WITH_CLOUDWARE targets to Makefile.vm.

  Note: There is no 'cloudware-install' target yet, since some of the
  disk image names may need to be specific to the provider, so this is
  probably best handled by the build scripts.

 r277606:
  Provide a recipe of "true" for building the "release" target once
  its prerequisites are satisfied, in order to avoid having an implicit
  rule triggered by the presence of release.sh.

 r277609:
  When iterating through VMFORMATS, the VMBASE file is not removed
  or truncated to a zero-size file, which if used to create more
  than one disk image format, can result in accidental pollution of
  the target formatted disk image.

  Instead of using a single VMBASE image (vm.img, by default), use
  a single base file for each format, named as VMFORMAT.img, which
  produces VMBASE.VMFORMAT as the final formatted image.

 r277836:
  Rename the 'system' target to 'disc1', which is specific to the
  disc1.iso installer image.

  Replace 'system' with 'release' in CLEANFILES, and add 'disc1'
  to CLEANDIRS.

  Ensure the 'dvd' target depends on 'packagesystem'.

  Fix 'mini-memstick.img' prerequisite, which should be the 'bootonly'
  target, not 'disc1' (previously 'system').

  Use .TARGET as the target installation directory for the disc1.iso
  and bootonly.iso images, which now expand to 'disc1' and 'bootonly'
  respectively, mimicking the behavior of the 'dvd' target.

  Remove '@true' from the 'release' target, and instead use
  'touch ${.TARGET}' to prevent multiple iterations of
  'make release' from clobbering previously-built installer
  medium.

 r277839:
  Update release(7) to reflect renaming the 'system' target to 'disc1'.

 r278118:
  Move service_enable="YES" rc.conf(5) additions to VM_RC_LIST and
  deduplicate.

  Evaluate if firstboot_freebsd_update should be enabled based on
  UNAME_r, because it is not supported for the -CURRENT or -STABLE
  branches.

 r278119:
  Use ifconfig_DEFAULT="" instead of hard-coding vtnet(4)

 r278206:
  Bump copyright after r277458.

 r278502:
  In scripts/mk-vmimage.sh, prevent incorrect usage() by defaulting
  VMCONFIG to /dev/null, and additionally ensuring VMCONFIG is not
  a character device before it is sourced.

  While here, be sure to exit if usage() is called.

  This should effectively be no-op, but the usage() output was
  discovered while investigating a larger issue.

* Several changes local to stable/10 were needed in order to handle
  UEFI images that are specific to this branch.

Tested with:	stable/10@r278906
Sponsored by:	The FreeBSD Foundation
2015-02-19 03:57:47 +00:00
emaste
7f01a931aa MFC r275140: Increase default and maximum callchain depths
Bump the default from 16 to 32, to accommodate kernel flamegraphs.
Bump the maximum from 32 to 128, to accommodate deep user stacks.

Sponsored by:	The FreeBSD Foundation
2015-02-19 02:56:34 +00:00
ken
c0ca6257a6 MFC 278228:
The __FreeBSD_version has been changed to 1001508 for the addition of the
CDAI_TYPE_EXT_INQ request type.

  ------------------------------------------------------------------------
  r278228 | ken | 2015-02-04 17:12:21 -0700 (Wed, 04 Feb 2015) | 32 lines

  Add support for probing the SCSI VPD Extended Inquiry page (0x86).

  This VPD page is effectively an extension of the standard Inquiry
  data page, and includes lots of additional bits.

  This commit includes support for probing the page in the SCSI probe code,
  and an additional request type for the XPT_DEV_ADVINFO CCB.  CTL already
  supports the Extended Inquiry page.

  Support for querying this page in the sa(4) driver will come later.

  sys/cam/scsi/scsi_xpt.c:
  	Probe the Extended Inquiry page, if the device supports it, and
  	return it in response to a XPT_DEV_ADVINFO CCB if it is requested.

  sys/cam/scsi/cam_ccb.h:
  	Define a new advanced information CCB data type, CDAI_TYPE_EXT_INQ.

  sys/cam/cam_xpt.c:
  	Free the extended inquiry data in a device when the device goes
  	away.

  sys/cam/cam_xpt_internal.h:
  	Add an extended inquiry data pointer and length to struct cam_ed.

  sys/sys/param.h
  	Bump __FreeBSD_version for the addition of the new
  	CDAI_TYPE_EXT_INQ advanced information type.

  Sponsored by:	Spectra Logic
  MFC after:	1 week

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

Sponsored by:	Spectra Logic
2015-02-18 23:08:13 +00:00
emaste
6bd13609ea MFC r276893: mkimg: Add MBR EFI partition type
Sponsored by:	The FreeBSD Foundation
2015-02-18 19:42:37 +00:00
sbruno
1936d78067 MFC r278827
Check for required arguments before accessing argv[0] and core dumping.
2015-02-18 16:28:55 +00:00
kib
e17da454ea MFC r278795:
Reparenting done by debugger attach can leave reaper without direct
children.  Handle the situation instead asserting that it is
impossible.
2015-02-18 08:10:13 +00:00