[FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-16:06.libc

FreeBSD Errata Notices errata-notices at freebsd.org
Wed May 4 22:56:31 UTC 2016

Hash: SHA512

FreeBSD-EN-16:06.libc                                           Errata Notice
                                                          The FreeBSD Project

Topic:          Performance regression in libc hash(3)

Category:       core
Module:         libc / hash(3)
Announced:      2016-05-04
Credits:        Bryan Drewery, Baptiste Daroussin
Affects:        FreeBSD 10.3-RELEASE
Corrected:      2016-04-13 01:54:36 UTC (stable/10, 10.3-STABLE)
                2016-05-04 15:25:47 UTC (releng/10.3, 10.3-RELEASE-p2)

For general information regarding FreeBSD Errata Notices and Security
Advisories, including descriptions of the fields above, security branches,
and the following sections, please visit

I.   Background

The dbopen(3) with DB_HASH allows reading and writing to database files
in the hash(3) format.  Examples of such files are the system master
passwd and services databases in /etc.  In FreeBSD 10.3 operations
using dbopen(3) were fixed to always call fsync(2) on their files when
writing to ensure they were consistent after a power loss.  This was
mostly noticeable for the user and group database files after using
pw, vipw, chpass, etc.

II.  Problem Description

The changes in FreeBSD 10.3 to use fsync(2) were improperly extended to
operations that were read-only.

III. Impact

This could manifest as extreme slowdowns in operations that read from one
of these files, such as the user database.  It was especially noticeable
during the use of "pkg install" since it reads from the user database.  It
could also incur excessive I/O writes to these files if the file system
was not mounted with noatime which could lessen the lifetime of SSD.

IV.  Workaround

No workaround is available.

V.   Solution

Perform one of the following:

1) Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date.

2) To update your present system via a binary patch:

Systems running a RELEASE version of FreeBSD on the i386 or amd64
platforms can be updated via the freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install

3) To update your present system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 10.3]
# fetch https://security.FreeBSD.org/patches/EN-16:06/libc.patch
# fetch https://security.FreeBSD.org/patches/EN-16:06/libc.patch.asc
# gpg --verify libc.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile the operating system using buildworld and installworld as
described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>.

Restart all daemons that use the library, or reboot the system.

VI.  Correction details

The following list contains the correction revision numbers for each
affected branch.

Branch/path                                                      Revision
- -------------------------------------------------------------------------
stable/10/                                                        r297904
releng/10.3/                                                      r299066
- -------------------------------------------------------------------------

To see which files were modified by a particular revision, run the
following command, replacing NNNNNN with the revision number, on a
machine with Subversion installed:

# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base

Or visit the following URL, replacing NNNNNN with the revision number:


VII. References

The latest revision of this Errata Notice is available at


More information about the freebsd-announce mailing list