Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Commits on Jul 19, 2013
@hrs-allbsd hrs-allbsd Add cdrom.inf into CD/DVD installation media. sysinstall(8) requires
this file to recognize the volume number.

Approved by:	re (marius)
@kostikbel kostikbel MFC r253398:
Add a tunable to force disable MSI use for xhci(4).

Approved by:	re (delphij)
@kostikbel kostikbel MFC r253280:
Only copy as much bytes as there in superblock, instead of the full
block copy, when copying the superblock into the snapshot.  UFS1 does
not align superblock on the block boundary, and bcopy runs off the end
of the buffer.

Approved by:	re (hrs)
gjb Update stable/9 to -BETA1 status.
Approved by:	re (implicit)
Approved by:	kib (mentor, implicit)
Commits on Jul 23, 2013
@jimharris jimharris MFC r253434:
  Add bus_dmamap_load_bio and bus_dmamap_load_ccb to bus_dma(9).

Approved by:	re (marius)
Commits on Jul 24, 2013
@rodrigc rodrigc MFC 253433:
    In this GRN, Marcel Moolenaar overhauled the logic for mounting
    the root file system on bootup:

       |r214006 | marcel | 2010-10-17 22:01:53 -0700 (Sun, 17 Oct 2010) | 20 lines
       | Re-implement the root mount logic using a recursive approach, whereby each
       |root file system (starting with devfs and a synthesized configuration) can
       |contain directives for mounting another file system as root.

    This commit adds a mount.conf(8) man page which documents
    the root mount logic.  mount.conf(8) also provides some examples
    for the /.mount.conf file, which can be used to change the root mount behavior.

    Reviewed by: marcel bjk

MFC: 253445:

    Minor mdoc fixes

Approved by: re (gjb)
ache 1) POSIX requires rand(3) return values to be in the [0, RAND_MAX]
range, but ACM formula we use have internal state (and return value) in
the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached
because it is off by one, zero is not reached too.

Correct both RAND_MAX and rand(3) return value, shifting last one
to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new
RAND_MAX)] range.

2) Add a checks for not overflowing on too big seeds. It may happens on
the machines, where sizeof(unsigned int) > 32 bits.

This change is binary compatible because range is reduced, not expanded,
so no bump is needed.

Reviewed by:    bde
Approved by:    re (glebius)
rmacklem MFC: r253506
The NFSv4 server incorrectly assumed that the high order words of
the attribute bitmap argument would be non-zero. This caused an
interoperability problem for a recent patch to the Linux NFSv4 client.
The Linux folks have changed their patch to avoid this, but this
patch fixes the problem on the server.

Reported and tested by: (Andre Heider)
Approved by:	re (Xin Li)
@avg-I avg-I MFC r253380,253413: name passed into __setenv is not necessarily NUL-…

Approved by:	re (kib)
gjb Modernize the package list for 9.2-RELEASE cycle:
 o Update the perl package version to 5.14.

 o Add devel/subversion and devel/subversion-static so we provide
   a package for source-based users to check out the various trees,
   both with and without extra dependencies.

This is a direct commit to stable/9.

Approved by:	kib (mentor)
Approved by:	re (glebius)
@juikim juikim MFC: r253439
Reload font when syscons(4) is resuming without switching mode.

Approved by:	re (delphij)
@juikim juikim MFC: r253455
Decode PCIe ASPM capability and status.

Approved by:	re (delphij)
@jimharris jimharris MFC r253393:
  Do not throw an error if the user requests to activate the image from
  an empty firmware slot, as long as the user has specified a firmware
  image to download into the empty firmware slot.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253436, r253458:
  Simplify open_dev() by returning errno values rather than just 0 or 1.

  Also remove stat() call and just rely on errno from open() call to discern
  whether dev node exists or not.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253437:
  Define constants for the lengths of the serial number, model number
  and firmware revision in the controller's identify structure.

  Also modify consumers of these fields to ensure they only use the
  specified number of bytes for their respective fields.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253438:
  Use pause() instead of DELAY() when polling for completion of admin
  commands during controller initialization.

  DELAY() does not work here during config_intrhook context - we need to
  explicitly relinquish the CPU for the admin command completion to
  get processed.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253459:
  Use _PATH_DEV (from paths.h) for the "/dev/" string, rather than
  hard-coding it.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253473:
  Do not call disk_create() until we have completed all initialization of our
  internal disk structure.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253474:
  Fix nvme(4) and nvd(4) to support non 512-byte sector sizes.

  Recent testing with QEMU that has variable sector size support for
  NVMe uncovered some of these issues.  Chatham prototype boards supported
  only 512 byte sectors.

Approved by:	re (kib)
Sponsored by:	Intel
@jimharris jimharris MFC r253476:
  Add message when nvd disks are attached and detached.

  As part of this commit, add an nvme_strvis() function which borrows
  heavily from cam_strvis().  This will allow stripping of
  leading/trailing whitespace and also handle unprintable characters
  in model/serial numbers.  This function goes into a new nvme_util.c
  file which is used by both the driver and nvmecontrol.

Approved by:	re (kib)
Sponsored by:	Intel
Commits on Jul 25, 2013
gjb MFC r253513, r253542:
 Create memstick images with the '.img' filename extension.

 For consistency with previous releases, name the cdrom install
 cd 'disc1.iso'.

Approved by:	kib (mentor)
Approved by:	re (marius)
@cperciva cperciva MFC r253541:
  Remove weirdly-named autofoo file.  This is not needed for the (FreeBSD)
  build, and freebsd-update chokes on it.

Approved by:	re (delphij)
@avg-I avg-I protect acpi_battery_ioctl with Giant
This is a direct commit to stable/9.

There is a bug in the ACPICA version 20110527 that is used in stable/9.
The bug can lead to unprotected reference counting on ACPI objects
and eventually to a crash or a memory corruption.  The bug has been fixed
upstream and imported to head as of ACPICA version 20130328.
Unfortunately, ACPICA version in stable has not been updated,
so merging all past ACPICA versions or cherry-picking parts of 20130328
would be a big change with a risk of potential regressions.

During debugging it was determined that the most probable vector for the
bug was through concurrent calls to ACPI battery sysctls and ioctls.
The sysctls are already guarded by Giant (not MPSAFE), but ioctls could
execute in parallel to a sysctl call and to each other. All the calls
go through acpi_battery_ioctl function, which makes the actual calls
into ACPICA and those are the calls that lack necessary protection.
Thus preventing concurrency in acpi_battery_ioctl should prevent the
conditions that triggered the ACPICA bug.

Some additional details can be found in this thread:

Tested by:,
		David Demelier <>
Approved by:	re (kib)
Commits on Jul 26, 2013
yongari MFC r253404:
   o TxD ring requires 8 bytes alignment to work so change alignment
     constraint to 8. Previously it may have triggered watchdog
   o Check whether interrupt is ours or not.
   o Enable interrupts before attemping to transmit queued packets.
     This will slightly improve TX performance.
   o No need to clear IFF_DRV_OACTIVE in a loop. AE_FLAG_TXAVAIL is
     used to know whether there are enough available TxD ring space.
   o Added missing bus_dmamap_sync(9) in ae_rx_intr() and rearranged
     code to avoid unncessary register access.
   o Make sure to clear TxD, TxS, RxD rings in driver initialization.
     Otherwise some data in these rings could be interpreted as
     'updated' which in turn will advance internally maintained
     pointers and can trigger watchdog timeouts.

  PR:	kern/180382
  Approved by:	re (hrs)
hselasky MFC r253532:
Fix an XHCI regression:

The Block Event Interrupts, BEI, feature does not
work like expected with the Renesas XHCI chipsets.
Revert feature.

While at it correct the TD SIZE computation in
case of Zero Length Packet, ZLP, in the end of a
multi frame USB transfer.

PR:             usb/180726
Approved by:    re, hrs
@hrs-allbsd hrs-allbsd MFC 253262, 253318, 243184, 253444, 253505, 253520:
- Add a leaf node CTL_NET.PF_ROUTE.0.AF.NET_RT_DUMP.0.FIB.  This returns
  routing table with the specified FIB number, not td->td_proc->p_fibnum.

- Add check_namevarlist() to check if ${name}_var is reserved in
  rc.subr or not.

- Fix a bug in ipv6_prefix_IF.  It did not work with the 64-bit prefix
  notation like 2001:db8:1:1.

- Use eui64 flag in ifconfig(8) instead of network6_getladdr()[*] for
  interface indentifier part.

- Fix address range specification with ifconfig(8) options such as:

  * inet netmask (inet range spec + ifconfig options)
  * inet6 2001:db8:1::1-f prefixlen 60 (inet6 range spec + ifconfig options)

  If prefixlen or netmask option is specified with CIDR notation at
  the same time, the option is used.

-  Do not set ND6_IFF_ACCEPT_RTADV on if_bridge(4) interfaces when

Approved by:	re (marius)
@delphij delphij Fix Denial of Service vulnerability in named(8). [13:07]
Security:	CVE-2013-4854
Security:	FreeBSD-SA-13:07.bind
Approved by:	re (rodrigc)
gjb Update stable/9 branch to -BETA2 status.
Approved by:	re (implicit)
Approved by:	kib (mentor, implicit)
Commits on Jul 27, 2013
@rodrigc rodrigc Approved by: re (hrs, marius)
MFC 253346:

    PR: 168520 170096
    Submitted by: adrian, zec

    Fix multiple kernel panics when VIMAGE is enabled in the kernel.
    These fixes are based on patches submitted by Adrian Chadd and Marko Zec.

    (1)  Set curthread->td_vnet to vnet0 in device_probe_and_attach() just before calling
     device_attach().  This fixes multiple VIMAGE related kernel panics
     when trying to attach Bluetooth or USB Ethernet devices because
     curthread->td_vnet is NULL.

    (2)  Set curthread->td_vnet in if_detach().  This fixes kernel panics when detaching networking
         interfaces, especially USB Ethernet devices.

    (3)  Use VNET_DOMAIN_SET() in ng_btsocket.c

    (4)  In ng_unref_node() set curthread->td_vnet.  This fixes kernel panics
         when detaching Netgraph nodes.
Commits on Jul 29, 2013
np MFC r253217,253699
Attach to the 4x10G T540-CR card.

Expand the list of devices claimed by cxgbe(4).

Approved by:	re (kib)
np MFC r253407:
Specify a timeout for the PL block.

Approved by:	re (kib)
Commits on Jul 30, 2013
marius MFC: r253707
- Set the System Identifier in the Primary Volume Descriptor to FreeBSD
  rather than NetBSD.
- Correctly set the Expiration Time in the Primary Volume Descriptor;
  according to ISO 9660 unspecified date and time are denoted
  by the digit 0 in RBP 1 to 16 but the number 0 in RBP 17. [1]
- Merge iso9660_rrip.c rev. 1.11 from NetBSD: name_len should be read
  as unsigned byte. [2]
  Note: This is according to ISO 9660 9.1.10.
- Rock Ridge TF entries should use a length of 5, because after the 4
  bytes of generic SUSP header there is one byte of flags. See typedef
  of ISO_RRIP_TF in iso9660_rrip.h. [1]

Submitted by:	Thomas Schmitt [1]
Approved by:	re (kib)
Obtained from:	NetBSD [2]
marius MFC: r253675
Ensure that makefs.h is included when using ufs_bswap.h so the FFS_EI macro
is picked up when defined. Previously, ffs_subr.c was always built without
support for opposite endianess as it doesn't include makefs.h on its own.

Approved by:	re (kib)
marius MFC: 253676
- Once we have shifted arguments thrice, base-bits-dir is $1 rather than $4.
  Introduce $BASEBITSDIR for clarity and in order to avoid repeating this
  mistake in the future. Fixing this ensures that we pick up the newly built
  boot code and loader native to the target, which is especially relevant
  when cross-building release images.
- It is pointless to specify an endianess for ISO 9660 images so strip that.

Approved by:	re (kib)
jlh MFC r253554:
  Fix a panic in the racct code when munlock(2) is called with incorrect values.

  The racct code in sys_munlock() assumed that the boundaries provided by
  the userland were correct as long as vm_map_unwire() returned
  successfully.  However the latter contains its own logic and sometimes
  manages to do something out of those boundaries, even if they are buggy.
  This change makes the racct code to use the accounting done by the vm
  layer, as it is done in other places such as vm_mlock().

  Despite fixing the panic, Alan Cox pointed that this code is still
  race-y though: two simultaneous callers will produce incorrect values.

  Reviewed by:  alc

MFC r253556:
  Fix previous commit when option RACCT is not used.

Approved by:	re (kib)
obrien MFC: r238896, r238897, r241331 (usr.bin/script/ only), r241972, r242138,
     r248388, 253814

+ Add "-f" to also output filemon(4) information.
+ Add d, p and r switches for recording script sessions with timing data
  and playing sessions back with or without time delays.
+ Remove contractions.

Approved by:	releng (glebius)
Commits on Jul 31, 2013
@trasz trasz MFC r249328:
Make ctladm(8) try to load ctl.ko kernel module if needed.

Approved by:	re (delphij)
marius Revert r249530 and re-enable compilation of ctl.ko for all configurat…

except i386 XEN, for which it still doesn't build so far.
This is a direct commit to stable/9.

Approved by:	re (delphij, kib)
Commits on Aug 01, 2013
@amotin amotin MFC r253754:
Partially close race between calls of orphan() method from GEOM and close()
method from ZFS core, that reliably causes use-after-free panic if SSD vdev
detached during inititial erase.

Approved by:	re (delphij)
marius MFC: r249410 (partial)
Remove ctl(4) from GENERIC.

With ctl(4) being built as a module and automatically loaded by ctladm(8),
this makes CTL work out of the box.

Note that unlike the original r249410, this commit does not remove the tunable for POLA reasons.

PR:		174671, 175694, 179112
Reviewed by:	ken (original version)
Sponsored by:	FreeBSD Foundation (original version)
Approved by:	re (hrs)
Commits on Aug 02, 2013
@hrs-allbsd hrs-allbsd MFC 253751 and 253843:
- Relax the restriction on the member interfaces with LLAs.  Two or more
  LLAs on the member interfaces are actually harmless when the parent
  interface does not have a LLA.

- Add  This is a knob to allow LLAs on
  a bridge and the member interfaces at the same time.  The default is 0.

Approved by:	re (marius)
ache MFC r253810
grep -i does not work for simple patterns and single byte locales, like
	LANG=ru_RU.KOI8-R grep -i <some single KOI8-R letter>
Fix it.

Approved by:    re (delphij,kib)
smh MFC r253818:
Fix zfs send -D hang after processing requiring a CTRL+C to interrupt due to
pthread_join prior to fd close.

Approved by:	re (delphij)
Commits on Aug 03, 2013
gjb - Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
- Update branch name to -RC1.
- Bump __FreeBSD_version.

Approved by:	kib (mentor, implicit)
Approved by:	re (implicit)
Commits on Aug 06, 2013
jfv MFC r253865: Fixes to RX_COPY optimization code allowing the removal …
…of rearm_queues

             routine used in the local_timer.
    r253965: Correct the queue mask bit clearing in the link irq handler.

Approved by: re
@bsdjhb bsdjhb MFC 253048,253423,253449,253653,253774,253785:
- Allow mlx4 devices to switch between Ethernet and Infiniband:
  - Fix sysfs attribute handling by using sysctl_handle_string() and
    properly handling trailing newlines in attribute values.
  - Remove check forbidding requests that would result in one port being
    set to Ethernet and the subsequent port being set to IB.
- Avoid trashing IP fragments by correctly managing hardware checksumming.
- Fix panics when downing or unloading the mlx4 driver.

PR:		kern/179999, kern/174213, kern/180430, kern/180791
Approved by:	re (kib)
jfv When the igb driver is static there are cases when early interrupts o…

resulting in a panic in refresh_mbufs, to prevent this add a check to the
interrupt handler for DRV_RUNNING.

Approved by: re
Commits on Aug 07, 2013
@kostikbel kostikbel Revert the MFC of the r244237, done as r244806. There are indeed bugs
in XEN pmap.  The revert hides a panic with the cost of non-working
vfork(2), which means more obscure misbehaviour in the usermode.
Revert is only done on the stable branch to maintain the consistent
erratic behaviour.

PR:	kern/180788
Approved by:	re (marius)