From owner-doc-jp-work@jp.FreeBSD.org Thu Dec 16 13:15:00 2004
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id iBG4F0f43395;
	Thu, 16 Dec 2004 13:15:00 +0900 (JST)
	(envelope-from owner-doc-jp-work@jp.FreeBSD.org)
Received: from mail.allbsd.org (gatekeeper.allbsd.org [3ffe:501:1888:1::32])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet6 id iBG4Ex843353
	for <doc-jp-work@jp.FreeBSD.org>; Thu, 16 Dec 2004 13:14:59 +0900 (JST)
	(envelope-from hrs@FreeBSD.org)
Received: from delta.allbsd.org (p7219-adsau13honb4-acca.tokyo.ocn.ne.jp [220.98.56.219])
        (user=relay mech=DIGEST-MD5 bits=128)
        by mail.allbsd.org (8.13.1/8.13.1) with ESMTP id iBG4Evmi058519
        for <doc-jp-work@jp.FreeBSD.org>; Thu, 16 Dec 2004 13:14:58 +0900 (JST)
	(envelope-from hrs@FreeBSD.org)
Received: from localhost (alph.allbsd.org [192.168.0.10])
	by delta.allbsd.org (8.13.1/8.13.1) with ESMTP id iBG4ECnU094126
	for <doc-jp-work@jp.FreeBSD.org>; Thu, 16 Dec 2004 13:14:13 +0900 (JST)
	(envelope-from hrs@FreeBSD.org)
Message-Id: <20041216.131250.74748902.hrs@eos.ocn.ne.jp>
To: doc-jp-work@jp.FreeBSD.org
From: Hiroki Sato <hrs@FreeBSD.org>
In-Reply-To: <200412020012.iB20CQ14039498@freefall.freebsd.org>
References: <200412020012.iB20CQ14039498@freefall.freebsd.org>
X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530  FFD7 4F2C D3D8 2793 CF2D
X-Mailer: Mew version 4.1.50 on Emacs 21.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Multipart/Signed; protocol="application/pgp-signature";
 micalg=pgp-sha1;
 boundary="--Security_Multipart0(Thu_Dec_16_13_12_50_2004_805)--"
Content-Transfer-Encoding: 7bit
Reply-To: doc-jp-work@jp.FreeBSD.org
Precedence: list
Date: Thu, 16 Dec 2004 13:12:50 +0900
X-Sequence: doc-jp-work 1022
Subject: [doc-jp-work 1022] Re: [FreeBSD-Announce] FreeBSD Security Advisory
 FreeBSD-SA-04:17.procfs
Sender: owner-doc-jp-work@jp.FreeBSD.org
X-Originator: hrs@FreeBSD.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+041128

----Security_Multipart0(Thu_Dec_16_13_12_50_2004_805)--
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Thu_Dec_16_13_12_50_2004_586)--"
Content-Transfer-Encoding: 7bit

----Next_Part(Thu_Dec_16_13_12_50_2004_586)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$B:4F#!wEl5~M}2JBg3X$G$9!#(B

 $BCY$/$J$j$^$7$?!#(B04:17 $B$G$9!#(B

--
| $B:4F#(B $B9-@8!wEl5~M}2JBg3X(B

----Next_Part(Thu_Dec_16_13_12_50_2004_586)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="04:17"

FreeBSD $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG(B
=============================================================================
FreeBSD-SA-04:17.procfs (2004-12-01)
 * Kernel memory disclosure in procfs and linprocfs
=============================================================================

 $B$3$N%a!<%k$O(B, announce-jp $B$KN.$l$?(B

  Subject: ANNOUNCE: [FreeBSD-Announce] FreeBSD Security Advisory FreeBSD-SA-04:17.procfs
  From: FreeBSD Security Advisories <security-advisories@freebsd.org>
  Date: Thu, 2 Dec 2004 00:12:26 GMT
  Message-Id: <200412020012.iB20CQ14039498@freefall.freebsd.org>
  X-Sequence: announce-jp 1258

 $B$rF|K\8lLu$7$?$b$N$G$9!#(B

 $B86J8$O(B PGP $B=pL>$5$l$F$$$^$9$,!"$3$NF|K\8lLu$O(B PGP $B=pL>$5$l$F$$$^$;$s!#(B
 $B=$@5%Q%C%AEy$NFbMF$,2~$6$s$5$l$F$$$J$$$3$H$r3NG'$9$k$?$a$K(B PGP $B=pL>$N(B
 $B%A%'%C%/$r$*$3$J$&$K$O!"86J8$r;2>H$7$F$/$@$5$$!#(B

 $BF|K\8lLu$*$h$S%_%i!<%5%$%HMxMQ$N>\:Y$K$D$$$F$O!"J8Kv$N!V(BA. FreeBSD
 $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG$K$D$$$F!W$r$4Mw$/$@$5$$!#(B


                                     [$BK]Lu<T(B: $B:4F#(B $B9-@8(B <hrs@jp.FreeBSD.org>]
--($B$3$3$+$i(B)
=============================================================================
FreeBSD-SA-04:17.procfs                                     Security Advisory
                                                          The FreeBSD Project

$B%H%T%C%/(B:       procfs $B$H(B linprocfs $B$K$*$1$k%+!<%M%k%a%b%j$NO31LLdBj(B
                (Kernel memory disclosure in procfs and linprocfs)

$BJ,N`(B:           core
$B%b%8%e!<%k(B:     sys
$B9pCNF|(B:         2004-12-01
$B%/%l%8%C%H(B:     Bryan Fulton, Ted Unangst, SWAT analysis tool (Coverity, Inc.)
$B1F6AHO0O(B:       FreeBSD $B$N$9$Y$F$N%j%j!<%9(B
$B=$@5F|(B:         2004-12-01 21:33:35 UTC (RELENG_5, 5.3-STABLE)
                2004-12-01 21:34:23 UTC (RELENG_5_3, 5.3-RELEASE-p2)
                2004-12-01 21:34:43 UTC (RELENG_5_2, 5.2.1-RELEASE-p13)
                2004-12-01 21:33:57 UTC (RELENG_4, 4.10-STABLE)
                2004-12-01 21:35:10 UTC (RELENG_4_10, 4.10-RELEASE-p5)
                2004-12-01 21:35:57 UTC (RELENG_4_8, 4.8-RELEASE-p27)
CVE Name:       CAN-2004-1066

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/>.

$B>e5-$N3F9`L\$d%;%-%e%j%F%#%V%i%s%A!"0J2<$N3F@a$D$$$F$N@bL@$J$I!"(B
FreeBSD $B%;%-%e%j%F%#4+9p$K$D$$$F$N0lHLE*$J>pJs$O!"(B
<URL:http://www.freebsd.org/security/> $B$r$4Mw$/$@$5$$!#(B


I.   $BGX7J(B - Background

The process file system, procfs(5), implements a view of the system
process table inside the file system.  It is normally mounted on
/proc, and is required for the complete operation of programs such as
ps(1) and w(1).

$B%W%m%;%9%U%!%$%k%7%9%F%`(B procfs(5) $B$O!"%7%9%F%`$N%W%m%;%9%F!<%V%k$r(B
$B%U%!%$%k%7%9%F%`$H$7$F;2>H2DG=$K$7$?$b$N$G$9!#$3$l$ODL>o(B /proc $B$K(B
$B%^%&%s%H$5$l$k$b$N$G!"(Bps(1) $B$d(B w(1) $B$H$$$C$?%W%m%0%i%`$N5!G=$r40A4$K(B
$BMxMQ$9$k$K$O!"$3$N%W%m%;%9%U%!%$%k%7%9%F%`$,I,MW$K$J$j$^$9!#(B

The Linux process file system, linprocfs(5), emulates a subset of
Linux's process file system and is required for the complete operation
of some Linux binaries.

Linux $B%W%m%;%9%U%!%$%k%7%9%F%`(B linprocfs(5) $B$O!"(BLinux $B$N%W%m%;%9%U%!%$%k$N(B
$B0lIt$r%(%_%e%l!<%7%g%s$9$k$b$N$G$9!#(BLinux $B%P%$%J%j$NCf$K$O!"40A4$J(B
$BF0:n$N$?$a$K!"$3$l$rI,MW$H$9$k$b$N$,$"$j$^$9!#(B


II.  $BLdBj$N>\:Y(B - Problem Description

The implementation of the /proc/curproc/cmdline pseudofile in the procfs(5)
file system on FreeBSD 4.x and 5.x, and of the /proc/self/cmdline
pseudofile in the linprocfs(5) file system on FreeBSD 5.x reads a process'
argument vector from the process address space.  During this operation,
a pointer was dereferenced directly without the necessary validation
steps being performed.

FreeBSD 4.x $B$*$h$S(B 5.x $B$N(B procfs(5) $B$K4^$^$l$k(B /proc/curproc/cmdline $B$H!"(B
FreeBSD 5.x $B$N(B linprocfs(5) $B$K4^$^$l$k(B /proc/self/cmdline $B$H$$$&(B
$B5?;w%U%!%$%k$O!"%W%m%;%9$N0z?tG[Ns(B (argument vector) $B$r$=$N%W%m%;%9$N(B
$B%"%I%l%96u4V$+$iFI$_=P$9$h$&$K<BAu$5$l$F$$$^$9!#$7$+$7$3$NA`:n$G$O(B
$B;2>H$9$k%]%$%s%?$NCM$,@5$7$/8!>Z$5$l$:!"D>@\$=$N$^$^;2>H$5$l$F$7$^$$$^$9!#(B


III. $B1F6AHO0O(B - Impact

A malicious local user could perform a local denial of service attack by
causing a system panic; or he could read parts of kernel memory.  Such
memory might contain sensitive information, such as portions of the file
cache or terminal buffers.  This information might be directly useful, or
it might be leveraged to obtain elevated privileges in some way.  For
example, a terminal buffer might contain a user-entered password.

$B0-0U$r;}$C$?%m!<%+%k%f!<%6$,!"%7%9%F%`%Q%K%C%/$rH/@8$5$;$F(B
$B%m!<%+%k%7%9%F%`$K%5!<%S%9K832967b$r$*$3$J$C$?$j!"%+!<%M%k%a%b%j$N(B
$B0lIt$rFI$_=P$9$3$H$,$G$-$k2DG=@-$,$"$j$^$9!#%+!<%M%k%a%b%j$K$O!"(B
$B%U%!%$%k%-%c%C%7%e$dC<Kv%P%C%U%!$H$$$C$?%;%-%e%j%F%#>e=EMW$J>pJs$,(B
$B4^$^$l$F$$$k2DG=@-$,$"$j$^$9!#$3$N>pJs$OD>@\0-MQ2DG=$+$b$7$l$^$;$s$7!"(B
$B9b$$8"8B$rIT@5$KF@$k$?$a$K0-MQ$5$l$k$+$b$7$l$^$;$s!#$?$H$($P!"(B
$BC<Kv%P%C%U%!$K$O%f!<%6$,F~NO$7$?%Q%9%o!<%I$,4^$^$l$F$$$k$+$b$7$l$^$;$s!#(B

FreeBSD 4.x does not implement the /proc/self/cmdline pseudofile in
its linprocfs(5) file system, and is therefore only affected if the
procfs(5) file system is mounted.

FreeBSD 4.x $B$N(B linprocfs(5) $B%U%!%$%k%7%9%F%`$K$O(B /proc/self/cmdline
$B5?;w%U%!%$%k$,<BAu$5$l$F$$$J$$$?$a!"(Bprocfs(5) $B%U%!%$%k%7%9%F%`$,(B
$B%^%&%s%H$5$l$F$$$k>l9g$K$N$_!"$3$NLdBj$N1F6A$,$"$j$^$9!#(B

In its default configuration, FreeBSD 5.x does not utilize procfs(5)
or linprocfs(5) and will therefore be unaffected by this vulnerability
unless the configuration is changed.

procfs(5) $B$H(B linprocfs(5) $B$ON>J}$H$b!"(BFreeBSD 5.x $B$N%G%U%)%k%H@_Dj$G$O(B
$BM-8z$K$J$C$F$$$^$;$s!#$=$N$?$a!"@_Dj$rJQ99$7$F$$$J$$(B FreeBSD 5.x
$B%7%9%F%`$K$O!"$3$NLdBj$N1F6A$O$"$j$^$;$s!#(B

IV.  $B2sHrJ}K!(B - Workaround

Unmount the procfs and linprocfs file systems if they are mounted.
Execute the following command as root:

procfs $B$H(B linprocfs $B%U%!%$%k%7%9%F%`$,%^%&%s%H$5$l$F$$$?$i!"$=$l$i$r(B
$B%"%s%^%&%s%H$7$^$9!#<!$N%3%^%s%I$r(B root $B8"8B$G<B9T$7$F$/$@$5$$!#(B

  umount -A -t procfs,linprocfs

Also, remove or comment out any lines in fstab(5) that reference
`procfs' or `linprocfs', so that they will not be re-mounted at next
reboot.

$B$^$?!"(Bfstab(5) $B$K$"$k!"(Bprocfs $B$H(B linprocfs $B$r;XDj$7$F$$$k9T$r(B
$B%3%a%s%H%"%&%H$7$F!"$=$l$i$,:F5/F0;~$K%^%&%s%H$5$l$J$$$h$&$K$7$^$9!#(B


V.   $B2r7h:v(B - Solution

Perform one of the following:
$B<!$N$$$:$l$+$R$H$D$K=>$C$F$/$@$5$$!#(B

1) Upgrade your vulnerable system to 4-STABLE or 5-STABLE, or to the
RELENG_5_3, RELENG_5_2, RELENG_4_10, or RELENG_4_8 security branch dated
after the correction date.

1) $B<eE@$r;}$C$?(B FreeBSD $B%7%9%F%`$r:G?7$N(B 4-STABLE $B$^$?$O(B 5-STABLE $B$K99?7$9$k$+!"(B
   $B$"$k$$$O=$@5F|0J9_$N(B RELENG_5_3, RELENG_5_2, RELENG_4_10, RELENG_4_8
   $B%;%-%e%j%F%#%V%i%s%A$N$$$:$l$+$K%"%C%W%0%l!<%I$9$k!#(B

2) To patch your present system:
2) $B8=:_$N%7%9%F%`$K=$@5%Q%C%A$rE,MQ$9$k!#(B

The following patches have been verified to apply to FreeBSD 4.8, 4.10,
5.2, and 5.3 systems.
$B0J2<$N=$@5%Q%C%A$O!"(BFreeBSD 4.8, FreeBSD 4.10, FreeBSD 5.2, FreeBSD 5.3
$B$N3F%7%9%F%`$KE,MQ2DG=$J$3$H$,3NG'$5$l$F$$$k$b$N$G$9!#(B

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.
a) $B0J2<$N>l=j$+$i=$@5%Q%C%A$r%@%&%s%m!<%I$7!"(BPGP $B%f!<%F%#%j%F%#$r;H$C$F(B
   PGP $B=pL>$r3NG'$7$^$9!#(B

[FreeBSD 4.x]
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:17/procfs4.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:17/procfs4.patch.asc

[FreeBSD 5.x]
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:17/procfs5.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:17/procfs5.patch.asc

b) Apply the patch.
b) $B=$@5%Q%C%A$rE,MQ$7$^$9!#(B

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

($BLuCm(B: /path/to/patch $B$NItJ,$O=$@5%Q%C%A$N%Q%9L>$KCV$-49$($F$/$@$5$$(B)

c) Recompile your kernel as described in
<URL:http://www.freebsd.org/handbook/kernelconfig.html> and reboot the
system.
c) <URL:http://www.freebsd.org/handbook/kernelconfig.html> $B$K=q$+$l$F$$$k(B
   $B<j=g$K=>$C$F%+!<%M%k$r:F9=C[$7$F!"%7%9%F%`$r:F5/F0$7$^$9!#(B


VI.  $B=$@5$N>\:Y(B - Correction details

The following list contains the revision numbers of each file that was
corrected in FreeBSD.
FreeBSD $B$K$*$$$F:#2s=$@5$5$l$?3F%U%!%$%k$N%j%S%8%g%sHV9f$O!"0J2<$N$H$*$j$G$9!#(B

Branch                                                           Revision
$B%V%i%s%A(B                                                         $B%j%S%8%g%s(B
  Path
  $B%Q%9L>(B
- -------------------------------------------------------------------------
RELENG_4
  src/sys/miscfs/procfs/procfs_status.c                          1.20.2.6
RELENG_4_10
  src/UPDATING                                              1.73.2.90.2.6
  src/sys/conf/newvers.sh                                   1.44.2.34.2.7
  src/sys/miscfs/procfs/procfs_status.c                      1.20.2.5.4.1
RELENG_4_8
  src/UPDATING                                             1.73.2.80.2.30
  src/sys/conf/newvers.sh                                  1.44.2.29.2.28
  src/sys/miscfs/procfs/procfs_status.c                      1.20.2.4.8.2
RELENG_5
  src/sys/compat/linprocfs/linprocfs.c                           1.84.2.1
  src/sys/fs/procfs/procfs_status.c                              1.52.2.1
RELENG_5_3
  src/UPDATING                                             1.342.2.13.2.5
  src/sys/compat/linprocfs/linprocfs.c                           1.84.4.1
  src/sys/conf/newvers.sh                                   1.62.2.15.2.7
  src/sys/fs/procfs/procfs_status.c                              1.52.4.1
RELENG_5_2
  src/UPDATING                                                 1.282.2.21
  src/sys/compat/linprocfs/linprocfs.c                           1.78.2.1
  src/sys/conf/newvers.sh                                       1.56.2.20
  src/sys/fs/procfs/procfs_status.c                              1.49.2.1
- -------------------------------------------------------------------------

A.   FreeBSD $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG$K$D$$$F(B

$BF|K\8lLu$O(B FreeBSD $BF|K\8l%I%-%e%a%s%F!<%7%g%s%W%m%8%'%/%H(B (doc-jp) $B$,(B
$B;29M$N$?$a$KDs6!$9$k$b$N$G$9!#2a5n$NF|K\8lHG%;%-%e%j%F%#4+9p$O(B

 http://www.FreeBSD.org/ja/security/

$B$K$^$H$a$i$l$F$$$^$9!#(B

$B$?$@$7K]Lu<T$*$h$S(B doc-jp $B$O!"$=$NFbMF$K$D$$$F$$$+$J$kJ]>Z$b(B
$B$$$?$7$^$;$s$N$G$4Cm0U$/$@$5$$!#F|K\8lLu$K$D$$$F$N$40U8+!"$4MWK>!"(B
$B$*Ld$$9g$o$;Ey$O(B doc-jp@jp.FreeBSD.org $B$^$G$*4j$$$7$^$9!#(B

$B$3$N4+9p$NCf$G>R2p$5$l$F$$$k(B WWW $B%5%$%H(B http://www.FreeBSD.org/ $B$*$h$S(B
FTP $B%5%$%H(B ftp://ftp.FreeBSD.org/ $B$K$O(B, $BF|K\$N%_%i!<%5%$%H$,B8:_$7$^$9!#(B
$B%M%C%H%o!<%/$N:.;($r4KOB$9$k$?$a!"$^$:$O%_%i!<%5%$%H$NMxMQ$r(B
$B9MN8$9$k$h$&$*4j$$$7$^$9!#(B

$BF|K\$N%_%i!<%5%$%H$rMxMQ$9$k$K$O!"(B
http://www.FreeBSD.org/ $B$r(B http://www.jp.FreeBSD.org/www.freebsd.org/ $B$K!"(B
ftp://ftp.FreeBSD.org/ $B$r(B ftp://ftp.jp.FreeBSD.org/ $B$K!"(B
$B$=$l$>$lCV$-49$($F$/$@$5$$!#(B

$BB>$NCO0h$r4^$`%_%i!<%5%$%H$K4X$9$k>\:Y$O(B

 http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mirrors.html ($B1QJ8(B)
 http://www.FreeBSD.org/doc/ja_JP.eucJP/books/handbook/mirrors.html ($BF|K\8lLu(B)

$B$K$^$H$a$i$l$F$$$^$9!#(B

$hrs: announce-jp/FreeBSD-SA/04:17,v 1.2 2004/12/16 04:09:17 hrs Exp $

----Next_Part(Thu_Dec_16_13_12_50_2004_586)----

----Security_Multipart0(Thu_Dec_16_13_12_50_2004_805)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQBBwQtETyzT2CeTzy0RAqCHAJ4wVRzlgVA9pJKPROmC4AjDl+8WnACgzNtf
+dAe0GJKJ7VCZb2FNSU8LRQ=
=7DcM
-----END PGP SIGNATURE-----

----Security_Multipart0(Thu_Dec_16_13_12_50_2004_805)----
