aboutsummaryrefslogtreecommitdiff
path: root/share/security/advisories/FreeBSD-SA-03:16.filedesc.asc
blob: 215c7419756460790cba2bd9e0fb435fe0144a7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
-----BEGIN PGP SIGNED MESSAGE-----
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@pine.nl>
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
-----END PGP SIGNATURE-----