[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UNIRAS Brief - 534/03 - FreeBSD Security Advisory:file descriptor leak in readv.



 
-----BEGIN PGP SIGNED MESSAGE-----

- ----------------------------------------------------------------------------------
   UNIRAS (UK Govt CERT) Briefing Notice - 534/03 dated 03.10.03  Time: 12:10
 UNIRAS is part of NISCC(National Infrastructure Security Co-ordination Centre)
- ---------------------------------------------------------------------------------- 
  UNIRAS material is also available from its website at www.uniras.gov.uk and
         Information about NISCC is available from www.niscc.gov.uk
- ----------------------------------------------------------------------------------

Title
=====

FreeBSD Security Advisory:file descriptor leak in readv.

Detail
====== 

A programming error in the readv system call can result in the given
file descriptor's reference count being erroneously incremented.


                ESB-2003.0699 -- FreeBSD-SA-03:16.filedesc
                       file descriptor leak in readv
                              03 October 2003


Product:                readv(2)
Publisher:              FreeBSD
Operating System:       FreeBSD 4.3-RELEASE through 4.8-RELEASE
                        4-STABLE and prior
Impact:                 Denial of Service
                        Increased Privileges
Access Required:        Existing Account

Hash: SHA1

=============================================================================
FreeBSD-SA-03:16.filedesc                                   Security Advisory
                                                          The FreeBSD Project

Topic:          file descriptor leak in readv

Category:       core
Module:         kernel
Announced:      2003-10-02
Credits:        Joost Pol <joost@xxxxxxx>
Affects:        FreeBSD 4.3-RELEASE through 4.8-RELEASE
                4-STABLE prior to the correction date
Corrected:      2003-10-02 15:08:01 UTC (RELENG_4, 4.9-RC)
                2003-10-02 15:54:48 UTC (RELENG_4_8, 4.8-RELEASE-p11)
                2003-10-02 15:55:54 UTC (RELENG_4_7, 4.7-RELEASE-p21)
                2003-10-02 15:56:56 UTC (RELENG_4_6, 4.6-RELEASE-p24)
                2003-10-02 15:57:48 UTC (RELENG_4_5, 4.5-RELEASE-p35)
                2003-10-02 15:58:53 UTC (RELENG_4_4, 4.4-RELEASE-p45)
                2003-10-02 16:05:44 UTC (RELENG_4_3, 4.3-RELEASE-p41)
FreeBSD only:   YES

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

I.   Background

The readv(2) system call performs a scatter read: it reads from the
input file descriptor and stores the data into multiple buffers as
instructed by the caller.

II.  Problem Description

A programming error in the readv system call can result in the given
file descriptor's reference count being erroneously incremented.

III. Impact

A local attacker may cause the operating system to crash by repeatedly
calling readv on a file descriptor until the reference count wraps to
a negative value, and then calling close on that file descriptor.

Similarly, it may be possible to cause a file descriptor to reference
unallocated kernel memory, but remain valid.  If a new file is later
opened and the kernel allocates the new file structure at the same
memory location, then an attacker may be able to gain read or write
access to that file.  This may in turn lead to privilege escalation.

IV.  Workaround

There is no workaround.

V.   Solution

The following patch has been verified to apply to FreeBSD 4.3, 4.4,
4.5, 4.6, 4.7, and 4.8 systems.

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

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:16/filedesc.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:16/filedesc.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.

VI.  Correction details

The following list contains the revision numbers of each file that was
corrected in FreeBSD.

Branch                                                           Revision
  Path
- - -------------------------------------------------------------------------
RELENG_4
  src/sys/kern/sys_generic.c                                    1.55.2.11
RELENG_4_8
  src/UPDATING                                             1.73.2.80.2.13
  src/sys/conf/newvers.sh                                  1.44.2.29.2.12
  src/sys/kern/sys_generic.c                               1.55.2.10.12.1
RELENG_4_7
  src/UPDATING                                             1.73.2.74.2.24
  src/sys/conf/newvers.sh                                  1.44.2.26.2.23
  src/sys/kern/sys_generic.c                               1.55.2.10.10.1
RELENG_4_6
  src/UPDATING                                             1.73.2.68.2.53
  src/sys/conf/newvers.sh                                  1.44.2.23.2.41
  src/sys/kern/sys_generic.c                                1.55.2.10.8.1
RELENG_4_5
  src/UPDATING                                             1.73.2.50.2.52
  src/sys/conf/newvers.sh                                  1.44.2.20.2.36
  src/sys/kern/sys_generic.c                                1.55.2.10.6.1
RELENG_4_4
  src/UPDATING                                             1.73.2.43.2.53
  src/sys/conf/newvers.sh                                  1.44.2.17.2.44
  src/sys/kern/sys_generic.c                                1.55.2.10.4.1
RELENG_4_3
  src/UPDATING                                             1.73.2.28.2.40
  src/sys/conf/newvers.sh                                  1.44.2.14.2.30
  src/sys/kern/sys_generic.c                                1.55.2.10.2.1
- - -------------------------------------------------------------------------

VII. References

<URL:http://www.pine.nl/press/pine-cert-20030901.txt>
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/fGDRFdaIBMps37IRAnkpAKCFM8MrujjJN1tc4lZwii573usNvgCfdBeP
APcFpW5FsH+sLkWczgjj6eE=
=6zO7


For additional information or assistance, please contact the HELP Desk by 
telephone or Not Protectively Marked information may be sent via EMail to:
uniras@xxxxxxxxxxxx

Office Hours:
Mon - Fri: 08:30 - 17:00 Hrs
Tel: +44 (0) 20 7821 1330 Ext 4511
Fax: +44 (0) 20 7821 1686

Outside of Office Hours:
On Call Duty Officer:
Tel: +44 (0) 20 7821 1330 and follow the prompts

- ----------------------------------------------------------------------------------
UNIRAS wishes to acknowledge the contributions of FreeBSD for the information
contained in this Briefing. 
- ----------------------------------------------------------------------------------
This Briefing contains the information released by the original author. Some 
of the information may have changed since it was released. If the vulnerability 
affects you, it may be prudent to retrieve the advisory from the canonical site 
to ensure that you receive the most current information concerning that problem.

Reference to any specific commercial product, process, or service by trade 
name, trademark manufacturer, or otherwise, does not constitute or imply 
its endorsement, recommendation, or favouring by UNIRAS or NISCC.  The views 
and opinions of authors expressed within this notice shall not be used for 
advertising or product endorsement purposes.

Neither UNIRAS or NISCC shall also accept responsibility for any errors 
or omissions contained within this briefing notice. In particular, they shall 
not be liable for any loss or damage whatsoever, arising from or in connection 
with the usage of information contained within this notice.

UNIRAS is a member of the Forum of Incident Response and Security Teams (FIRST) 
and has contacts with other international Incident Response Teams (IRTs) in 
order to foster cooperation and coordination in incident prevention, to prompt 
rapid reaction to incidents, and to promote information sharing amongst its 
members and the community at large. 
- ----------------------------------------------------------------------------------
<End of UNIRAS Briefing>
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQCVAwUBP31YOYpao72zK539AQHqRgQArgxPWhu3+1DKG6AEgpvAJpTwjSyV7+ZX
egHKUkzB6eyEASDQbS+4P8ooNuj7HeoNjiA0hd4FBPjkA/Wbrg+IAJMm0qvrsJS1
Hp12I1Rc3dgu+oQ0R5mzg1XNTwMT63NiBI/hWcj/3VBjsHJikHtmXZ6Ij1InMzrP
lJIacw6vsyU=
=KSwA
-----END PGP SIGNATURE-----