From owner-doc-jp-work@jp.FreeBSD.org Tue Aug  6 13:16:35 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g764GZb64736;
	Tue, 6 Aug 2002 13:16:35 +0900 (JST)
	(envelope-from owner-doc-jp-work@jp.FreeBSD.org)
Received: from smtp.eos.ocn.ne.jp (eos.ocn.ne.jp [211.6.83.117])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g764GZn64731
	for <doc-jp-work@jp.FreeBSD.org>; Tue, 6 Aug 2002 13:16:35 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
Received: from mail.allbsd.org (p11163-adsan10hon-acca.tokyo.ocn.ne.jp [218.43.54.163])
	by smtp.eos.ocn.ne.jp (Postfix) with ESMTP id B72C413B9
	for <doc-jp-work@jp.FreeBSD.org>; Tue,  6 Aug 2002 13:16:34 +0900 (JST)
Received: from localhost (alph.allbsd.org [192.168.0.10])
	by mail.allbsd.org (8.12.3/3.7W/DomainMaster) with ESMTP id g764G6Lu089427
	for <doc-jp-work@jp.FreeBSD.org>; Tue, 6 Aug 2002 13:16:07 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
Date: Tue, 06 Aug 2002 13:15:59 +0900 (JST)
Message-Id: <20020806.131559.31696474.hrs@eos.ocn.ne.jp>
To: doc-jp-work@jp.FreeBSD.org
From: Hiroki Sato <hrs@eos.ocn.ne.jp>
In-Reply-To: <200208052348.g75NmbIS097274@freefall.freebsd.org>
References: <200208052348.g75NmbIS097274@freefall.freebsd.org>
X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Tue_Aug__6_13:15:59_2002_379)--"
Content-Transfer-Encoding: 7bit
Reply-To: doc-jp-work@jp.FreeBSD.org
Precedence: list
X-Sequence: doc-jp-work 460
Subject: [doc-jp-work 460] Re: ANNOUNCE: FreeBSD Security Advisory FreeBSD-SA-02:35.ffs
Errors-To: owner-doc-jp-work@jp.FreeBSD.org
Sender: owner-doc-jp-work@jp.FreeBSD.org
X-Originator: hrs@eos.ocn.ne.jp
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+020727

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

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

 02:35 $B$G$9!#(B

  # 02:36 $B$H(B 02:37 $B$b<j$r$D$1$?$N$G$9$,!"(B
  # $B$A$H3NG'$7$?$$$3$H$,$"$k$N$G(B
  # $BJV;v$r<u$1$H$j<!Bh=P$7$^$9!#(B

--
| $B:4F#(B $B9-@8!wEl5~M}2JBg3X(B <hrs@eos.ocn.ne.jp>
|                         <hrs@FreeBSD.org> (FreeBSD Project)

----Next_Part(Tue_Aug__6_13:15:59_2002_379)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="02:35"

FreeBSD $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG(B
=============================================================================
FreeBSD-SA-02:35.ffs (2002-08-05)
 * local users may read and write arbitrary blocks on an FFS filesystem
=============================================================================

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

  Subject: ANNOUNCE: FreeBSD Security Advisory FreeBSD-SA-02:35.ffs
  From: FreeBSD Security Advisories <security-advisories@FreeBSD.org>
  Date: Mon, 5 Aug 2002 16:48:37 -0700 (PDT)
  Message-Id: <200208052348.g75NmbIS097274@freefall.freebsd.org>
  X-Sequence: announce-jp 1027

 $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%/$r9T$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-02:35.ffs                                        Security Advisory
                                                          The FreeBSD Project

$B%H%T%C%/(B:       $B%m!<%+%k%f!<%6$,(B FFS $B%U%!%$%k%7%9%F%`>e$NG$0U$N%V%m%C%/$r(B
                $BFI$_=q$-$G$-$kLdBj(B
                (local users may read and write arbitrary blocks on
                an FFS filesystem)

$BJ,N`(B:           core
$B%b%8%e!<%k(B:     kernel
$B9pCNF|(B:         2002-08-05
$B%/%l%8%C%H(B:     Matt Dillon <dillon@FreeBSD.org>,
                Ian Dowse <iedowse@FreeBSD.org>,
                Tor Egge <tegge@FreeBSD.org>
$B1F6AHO0O(B:       4.6.1-RELEASE-p4 $B$r4^$`!"$=$l0JA0$N$9$Y$F$N(B FreeBSD $B%j%j!<%9(B
                $B=$@5F|$h$jA0$N(B 4.6-STABLE
$B=$@5F|(B:         2002-06-23 22:34:52 UTC (RELENG_4)
                2002-07-31 17:55:22 UTC (RELENG_4_6)
                2002-07-31 17:55:11 UTC (RELENG_4_5)
                2002-07-31 17:54:57 UTC (RELENG_4_4)
FreeBSD $B$K8GM-$+(B:       YES


I.   $BGX7J(B - Background

The Berkeley Fast File System (FFS) is the default filesystem used by
FreeBSD.

Berkeley Fast File System (FFS) $B$O!"(BFreeBSD $B$,%G%U%)%k%H$G;HMQ$7$F$$$k(B
$B%U%!%$%k%7%9%F%`$G$9!#(B


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

A bug in the calculation of the maximum permitted FFS file size
allows users to create files that are larger than FreeBSD's virtual
memory system can handle. The integer overflows that result when such
files are accessed may map filesystem metadata into the user file,
permitting access to arbitrary filesystem blocks.

$BM-8z$J:GBg(B FFS $B%U%!%$%k%5%$%:$N7W;;=hM}$K%P%0$,$"$j!"%f!<%6$O(B
FreeBSD $B$N2>A[%a%b%j%7%9%F%`$,4IM}2DG=$JBg$-$5$rD6$($k%U%!%$%k$r(B
$B:n@.$9$k$3$H$,2DG=$G$9!#$=$N$h$&$J%U%!%$%k$X%"%/%;%9$7$?>l9g!"(B
$B@0?t$N%*!<%P%U%m!<$,H/@8$7!"%U%!%$%k%7%9%F%`$N%a%?%G!<%?$,(B
$B%f!<%6%U%!%$%kCf$K%^%C%W$5$l$F$7$^$$$^$9!#$3$l$rMxMQ$9$k$H!"(B
$B%U%!%$%k%7%9%F%`$NG$0U$N%V%m%C%/$K%"%/%;%9$9$k$3$H$,2DG=$K$J$j$^$9!#(B

The bug is encountered only on FFS filesystems with a block size of
16k or greater on the i386 architecture, or 32k or greater on the
alpha architecture.  Also, the filesystem must have at least 6 blocks
of free space, and the user must have write access to at least one
file in the filesystem.

$B$3$N%P%0$O!"(Bi386 $B%"!<%-%F%/%A%c>e$G$O%V%m%C%/%5%$%:$,(B 16k $B%P%$%H0J>e!"(B
alpha $B%"!<%-%F%/%A%c>e$G$O%V%m%C%/%5%$%:$,(B 32k $B%P%$%H0J>e$N(B FFS
$B%U%!%$%k%7%9%F%`$G$N$_!"LdBj$H$J$j$^$9!#$^$?!"%U%!%$%k%7%9%F%`>e$K(B
6 $B%V%m%C%/0J>e$NL$;HMQ6u4V$,$"$j!"0l$D$N%U%!%$%k$K=q$-9~$_%"%/%;%9$,(B
$B2DG=$G$"$k$H$$$&>r7o$,>/$J$/$H$bI,MW$K$J$j$^$9!#(B

The default FreeBSD FFS filesystem block size was changed from 8k to
16k on all architectures just before 4.5-RELEASE.

FreeBSD FFS $B%U%!%$%k%7%9%F%`$N%G%U%)%k%H%V%m%C%/%5%$%:$O!"$9$Y$F$N(B
$B%"!<%-%F%/%A%c$K$*$$$F(B 4.5-RELEASE $B$N8x3+D>A0$K(B 8k $B$+$i(B 16k $B$K(B
$BJQ99$5$l$^$7$?!#(B


III. $B1F6AHO0O(B - Impact

Local attackers may cause a denial of service by simply corrupting the
filesystem.  A local attacker may also be able to read and write
arbitrary files on local filesystems, allowing them to gain superuser
privileges.

$B%m!<%+%k$N967b<T$O!"%U%!%$%k%7%9%F%`$rGK2u$7$F%5!<%S%9K832$r(B
$B<B8=$9$k$3$H$,2DG=$G$9!#$^$?!"%m!<%+%k%U%!%$%k%7%9%F%`$N(B
$BG$0U$N%U%!%$%k$KFI$_=q$-%"%/%;%9$9$k$3$H$,$G$-$k$?$a!"(B
$B%9!<%Q%f!<%68"8B$rIT@5$KF~<j$G$-$k2DG=@-$,$"$j$^$9!#(B

FFS filesystems with a block size less than 16k (on the i386
architecture) or 32k (on the alpha architecture), such as those
created using the default FFS filesystem block size prior to
4.5-RELEASE, are not vulnerable.

4.5-RELEASE $B$h$jA0$K;H$o$l$F$$$?(B FFS $B%U%!%$%k%7%9%F%`$N(B
$B%G%U%)%k%H%V%m%C%/%5%$%:$r;H$C$F:n@.$5$l$?(B FFS $B%U%!%$%k%7%9%F%`$J$I!"(B
FFS $B%U%!%$%k%7%9%F%`$N%V%m%C%/%U%!%$%k%5%$%:$,(B 16k $B%P%$%HL$K~(B
(i386 $B%"!<%-%F%/%A%c$N>l9g(B)$B!"$"$k$$$O(B 32k $B%P%$%HL$K~(B (alpha
$B%"!<%-%F%/%A%c$N>l9g(B) $B$K$O!"$3$NLdBj$N1F6A$O$"$j$^$;$s!#(B

The following command can be used to determine the block size
used on a given filesystem:

$B%U%!%$%k%7%9%F%`$N%V%m%C%/%5%$%:$rD4$Y$k$K$O!"<!$N%3%^%s%I$r;H$$$^$9!#(B

  # dumpfs /some/filesystem | grep '^bsize'


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

On filesystems with 16k blocks, the bug cannot be exploited when a
process has a file size resource limit (RLIMIT_FSIZE) of 63 MB or
less.  This can be most easily accomplished by modifying
/etc/login.conf so that the appropriate login classes (typically
`default') contain a field entry such as the following:

16k $B%P%$%H$N%V%m%C%/%5%$%:$r;}$D%U%!%$%k%7%9%F%`>e$G$"$C$F$b!"%W%m%;%9$K(B
$B@_Dj$5$l$F$$$k%U%!%$%k%5%$%:$N%j%=!<%9@)8B(B (RLIMIT_FSIZE) $B$,(B 63MB $B0J2<$K(B
$B$J$C$F$$$l$P!"$3$N%P%0$r0-MQ$9$k$3$H$O$G$-$^$;$s!#$3$N@)8B$r9T$J$&(B
$B4JC1$JJ}K!$O!"(B/etc/login.conf $B$NE,@Z$J%m%0%$%s%/%i%9(B ($BBgDq$N>l9g$O(B
`default') $B$K!"<!$N$h$&$J%U%#!<%k%I$rDI2C$9$k$3$H$G$9!#(B

        :filesize=63m:\

After editing /etc/login.conf, the corresponding capability database
must be rebuilt with the following command:

/etc/login.conf $B$rJT=8$7$?8e$O!"<!$N%3%^%s%I$r<B9T$7$F!"BP1~$9$k(B
$B%1!<%Q%S%j%F%#%G!<%?%Y!<%9$b99?7$9$kI,MW$,$"$j$^$9!#(B

   # cap_mkdb /etc/login.conf

Please see login.conf(5) for details.  Note that this will not affect
currently running processes, nor new processes started by users who
are already logged in.

$B>\:Y$O(B login.conf(5) $B$r$4Mw$/$@$5$$!#$?$@$7!"$3$NA`:n$O<B9TCf$N(B
$B%W%m%;%9$d!"A`:nA0$K4{$K%m%0%$%s$7$F$$$k%f!<%6$,<B9T$9$k(B
$B?7$7$$%W%m%;%9$K$O8z2L$,$"$j$^$;$s$N$G$4Cm0U$/$@$5$$!#(B

The corresponding limit appropriate for filesystems with 32k or larger
blocks is not known at this time, and might be smaller or larger than
63 MB.

$B%V%m%C%/%5%$%:$,(B 32k $B%P%$%H$rD6$($k%U%!%$%k%7%9%F%`$N>l9g$KE,@Z$J(B
$B%j%=!<%9@)8BCM$,$$$/$D$G$"$k$+$O8=;~E@$GH=L@$7$F$$$^$;$s!#(B63M $B%P%$%H$h$j(B
$B>.$5$$$+$bCN$l$^$;$s$7!"5U$KBg$-$$$+$bCN$l$^$;$s!#(B

It is the responsibility of applications such as `login' and `sshd' to
read and honor login.conf.  Be aware that 3rd party applications that
provide login functionality may or may not honor login.conf.

login.conf $B$rFI$_9~$_@_Dj$rH?1G$5$;$k$N$O!"(B`login' $B$d(B `sshd' $B$J$I$N(B
$B%"%W%j%1!<%7%g%s$N;}$C$F$$$k5!G=$G$9!#%m%0%$%s5!G=$rDs6!$9$k(B
$B%5!<%I%Q!<%F%#@=%"%W%j%1!<%7%g%s$r;H$C$F$$$k>l9g$O!"(Blogin.conf $B$r(B
$BFI$_9~$`$N$+$I$&$+$r3NG'$9$kI,MW$,$"$k$G$7$g$&!#(B


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

1) Upgrade your vulnerable system to 4.6-STABLE; or to any of the
RELENG_4_6 (4.6.1-RELEASE-p5), RELENG_4_5 (4.5-RELEASE-p14), or
RELENG_4_4 (4.4-RELEASE-p21) security branches dated after the
respective correction dates.

1) $B<eE@$r;}$C$?(B FreeBSD $B%7%9%F%`$r=$@5F|0J9_$N(B 4.6-STABLE $B$K(B
   $B%"%C%W%0%l!<%I$9$k$+!"$b$7$/$O(B RELENG_4_6 (4.6.1-RELEASE-p5)$B!"(B
   RELENG_4_5 (4.5-RELEASE-p14)$B!"(BRELENG_4_4 (4.4-RELEASE-p21)
   $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

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.  The following patch
has been tested to apply to all FreeBSD 4.x releases.
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!#$3$N=$@5%Q%C%A$O!"(BFreeBSD 4.x $B%j%j!<%9$9$Y$F$K(B
   $BE,MQ$G$-$k$3$H$,3NG'$5$l$F$$$k$b$N$G$9!#(B

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:35/ffs.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:35/ffs.patch.asc

b) Recompile your kernel as described in
http://www.freebsd.org/handbook/kernelconfig.html and reboot the
system.
b) http://www.freebsd.org/handbook/kernelconfig.html $B$K=q$+$l$F$$$k(B
   $B<j=g$K$7$?$,$C$F%+!<%M%k$r:F9=C[$7!"%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


Path                                                             Revision
$B%Q%9L>(B                                                          $B%j%S%8%g%s(B
  Branch
  $B%V%i%s%A(B
- -------------------------------------------------------------------------
sys/ufs/ffs/ffs_vfsops.c
  RELENG_4                                                     1.117.2.10
  RELENG_4_6                                                1.117.2.9.2.1
  RELENG_4_5                                                1.117.2.7.2.1
  RELENG_4_4                                                1.117.2.3.2.1
sys/conf/newvers.sh
  RELENG_4_6                                               1.44.2.23.2.10
  RELENG_4_5                                               1.44.2.20.2.15
  RELENG_4_4                                               1.44.2.17.2.20
- -------------------------------------------------------------------------


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/handbook/mirror.html ($B1QJ8(B)
 http://www.FreeBSD.org/ja/handbook/mirror.html ($BF|K\8lLu(B)

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

$hrs: announce-jp/FreeBSD-SA/02:35,v 1.4 2002/08/06 04:15:55 hrs Exp $

----Next_Part(Tue_Aug__6_13:15:59_2002_379)----
