-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2013.1257
                  Kernel memory disclosure in sendfile(2)
                             11 September 2013

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           sendfile
Publisher:         FreeBSD
Operating System:  FreeBSD
Impact/Access:     Access Confidential Data -- Existing Account
Resolution:        Patch/Upgrade
CVE Names:         CVE-2013-5666  

Original Bulletin: 
   ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-13:11.sendfile.asc

- --------------------------BEGIN INCLUDED TEXT--------------------

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

=============================================================================
FreeBSD-SA-13:11.sendfile                                   Security Advisory
                                                          The FreeBSD Project

Topic:          Kernel memory disclosure in sendfile(2)

Category:       core
Module:         sendfile
Announced:      2013-09-10
Credits:        Ed Maste
Affects:        FreeBSD 9.2-RC1 and 9.2-RC2
Corrected:      2013-09-10 10:07:21 UTC (stable/9, 9.2-STABLE)
                2013-09-10 10:08:20 UTC (releng/9.2, 9.2-RC1-p2)
                2013-09-10 10:08:20 UTC (releng/9.2, 9.2-RC2-p2)
CVE Name:       CVE-2013-5666

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:http://security.FreeBSD.org/>.

I.   Background

The sendfile(2) system call allows a server application (such as an
HTTP or FTP server) to transmit the contents of a file over a network
connection without first copying it to application memory.  High
performance servers such as Apache and ftpd use sendfile.

II.  Problem Description

On affected systems, if the length passed to sendfile(2) is non-zero
and greater than the length of the file being transmitted, sendfile(2)
will pad the transmission up to the requested length or the next
pagesize boundary, whichever is smaller.

The content of the additional bytes transmitted in this manner depends
on the underlying filesystem, but may potentially include information
useful to an attacker.

III. Impact

An unprivileged user with the ability to run arbitrary code may be
able to obtain arbitrary kernel memory contents.

IV.  Workaround

No workaround is available.

V.   Solution

Perform one of the following:

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

2) To update your vulnerable 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 9.2-STABLE]
# fetch http://security.FreeBSD.org/patches/SA-13:11/sendfile-9.2-stable.patch
# fetch http://security.FreeBSD.org/patches/SA-13:11/sendfile-9.2-stable.patch.asc
# gpg --verify sendfile-9.2-stable.patch.asc

[FreeBSD 9.2-RC1 and 9.2-RC2]
# fetch http://security.FreeBSD.org/patches/SA-13:11/sendfile-9.2-rc.patch
# fetch http://security.FreeBSD.org/patches/SA-13:11/sendfile-9.2-rc.patch.asc
# gpg --verify sendfile-9.2-rc.patch.asc

b) Apply the patch.

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

c) Recompile your kernel as described in
<URL:http://www.FreeBSD.org/handbook/kernelconfig.html> and reboot the
system.

3) To update your vulnerable 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

VI.  Correction details

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

Branch/path                                                      Revision
- - -------------------------------------------------------------------------
stable/9/                                                         r255443
releng/9.2/                                                       r255444
- - -------------------------------------------------------------------------

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:

<URL:http://svnweb.freebsd.org/base?view=revision&revision=NNNNNN>

VII. References

<URL:http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5666>

The latest revision of this advisory is available at
<URL:http://security.FreeBSD.org/advisories/FreeBSD-SA-13:11.sendfile.asc>
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (FreeBSD)

iEYEARECAAYFAlIu8rIACgkQFdaIBMps37K01ACgmwaW3PZhjDqWSlTHusjIPNVy
A/YAn3DFUAvlX8sH89taM+sedjbD5In8
=gZwu
- -----END PGP SIGNATURE-----

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        http://www.auscert.org.au/render.html?cid=1980

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBUi/FFhLndAQH1ShLAQIaNg/+JsmN/EbEtpIi82DnVhlYuA4W8sSDkx1Y
J+aOmJhkgeMwszfubGNiejqmeK+sZvJTNoNyruDcpUYGASlk2WtjWA6uOy/qcVQn
BOsCqCywCvDyot11tRfvEzrtQRr97mLWplxrpl7fhYSjiy6qOwfyj2S7Vl0YEzol
fl68ASuI0FSwKle0X+mf1l3hp++z8HeWH6UvuFwKc//gfjvjkm+b57dIOSERhtgb
Wv1kvy/5X4dRrq9TqN9OcjVdypClhZDVW+zt7mq2bvMQYpE119tlXKaVGnWmtlu4
rHns+3LdmthUcof4SwK+qoiSdQC85w1BYNVEXq9gnKpc7E4i2IX+emkI7utggYV/
3MYcFbaTuANKHSafHikY8feNt9hEXk1cEYzkN0b79ANyNsznEIAGYq7pE0ZemK3g
1f84LfnPu1Vwc4kY+XktYx6UZu/vYDkGnVDaWpCtN2CrifiCqWPS9cDxOHk5Merv
FNif7IZNG3Va7osJdbD20kq28wohkE3wiKJSl7VkMJcDHFnDlBHnQO6ZRwOXmT8M
2xbucmpUMc6b2GEE74p+P/nIDYPpfDiqp4AJPtCmcJr+F7K6LRTT00INSNV/okyn
TsX+toZhcKt3UV5MH+edq4DORHkxA03hZWSGRgiwTrsc+zx7dqcmaX8J7ZvlqSKT
f2jDSGzH6Ww=
=7NNR
-----END PGP SIGNATURE-----