From owner-doc-jp@jp.FreeBSD.org Fri Jan 25 15:48:24 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g0P6mO377849;
	Fri, 25 Jan 2002 15:48:24 +0900 (JST)
	(envelope-from owner-doc-jp@jp.FreeBSD.org)
Received: from eos.ocn.ne.jp (eos.ocn.ne.jp [210.190.142.171])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g0P6mN677844
	for <doc-jp@jp.FreeBSD.org>; Fri, 25 Jan 2002 15:48:23 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
Received: from mail.hrslab.yi.org (p5126-ip02funabasi.chiba.ocn.ne.jp [61.214.4.126])
	by eos.ocn.ne.jp (OCN) with ESMTP id PAA20174
	for <doc-jp@jp.FreeBSD.org>; Fri, 25 Jan 2002 15:48:20 +0900 (JST)
Received: from localhost (alph.hrslab.yi.org [192.168.0.10])
	by mail.hrslab.yi.org (8.9.3/3.7W/DomainMaster) with ESMTP id PAA60234
	for <doc-jp@jp.FreeBSD.org>; Fri, 25 Jan 2002 15:46:51 +0900 (JST)
	(envelope-from hrs@eos.ocn.ne.jp)
Date: Fri, 25 Jan 2002 15:46:48 +0900 (JST)
Message-Id: <20020125.154648.45177325.hrs@eos.ocn.ne.jp>
To: doc-jp@jp.FreeBSD.org
From: Hiroki Sato <hrs@eos.ocn.ne.jp>
In-Reply-To: <200201242153.g0OLrSk75448@freefall.freebsd.org>
References: <200201242153.g0OLrSk75448@freefall.freebsd.org>
X-Mailer: Mew version 2.1 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Fri_Jan_25_15:46:48_2002_829)--"
Content-Transfer-Encoding: 7bit
Reply-To: doc-jp@jp.FreeBSD.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+011218
X-Sequence: doc-jp 8647
Subject: [doc-jp 8647] Re: ANNOUNCE: FreeBSD Security Advisory FreeBSD-SA-02:08.exec
Errors-To: owner-doc-jp@jp.FreeBSD.org
Sender: owner-doc-jp@jp.FreeBSD.org
X-Originator: hrs@eos.ocn.ne.jp

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

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

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

 $B!E!E$3$l$H4XO"$7$?(B NetBSD-SA 2002-001 $B$NK]Lu$b(B
 ($BCfESH>C<$K(B) $B$"$k$s$G$9$,!"Ej$29~$a$=$&$J$H$3$m$C$F$"$j$^$;$s$+$M(B?

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

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


FreeBSD $B%;%-%e%j%F%#4+9p(B $BF|K\8lHG(B
=============================================================================
FreeBSD-SA-02:08 (2002-01-24)
 * race condition during exec may allow local root compromise
=============================================================================

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

  Subject: ANNOUNCE: FreeBSD Security Advisory FreeBSD-SA-02:08.exec
  From: FreeBSD Security Advisories <security-advisories@FreeBSD.org>
  Date: Thu, 24 Jan 2002 13:53:28 -0800 (PST)
  Message-Id: <200201242153.g0OLrSk75448@freefall.freebsd.org>
  X-Sequence: announce-jp 913

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

 $B86J8$O(B PGP $B=pL>$5$l$F$$$^$9$,(B, $B$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(B, $B86J8$r;2>H$7$F$/$@$5$$(B. 

 $BF|K\8lLu$*$h$S(B, $B%_%i!<%5%$%HMxMQ$N>\:Y$K$D$$$F$O(B, $BJ8Kv$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:08                                            Security Advisory
                                                                FreeBSD, Inc.

$B%H%T%C%/(B:	exec(3) $B$N6%9g>uBV$K5/0x$9$k%m!<%+%k$N(B root $B8"8B$NIT@5MxMQLdBj(B
		(race condition during exec may allow local root compromise)

$BJ,N`(B:		core
$B%b%8%e!<%k(B:	kernel
$B9pCNF|(B:		2002-01-24
$B%/%l%8%C%H(B:	Logan Gabriel <gersh@sonn.com>,
                Robert Watson <rwatson@FreeBSD.org>,
                Dag-Erling Smograv <des@FreeBSD.org>
$B1F6AHO0O(B:	4.5-RELEASE $B$h$jA0$N$9$Y$F$N(B FreeBSD 4.x
                $B=$@5F|$h$jA0$N(B FreeBSD 4.4-STABLE
$B=$@5F|(B:		2002-01-22 17:22:59 UTC (4-STABLE, RELENG_4)
                2002-01-23 23:05:00 UTC (4.4-RELEASE-p4, RELENG_4_4)
                2002-01-23 23:05:53 UTC (4.3-RELEASE-p24, RELENG_4_3)
FreeBSD $B$K8GM-$+(B:	NO


I.   $BGX7J(B - Background

When a process is started from a set-user-ID or set-group-ID binary,
it is marked so that attempts to attach to it with debugging hooks
fail.  To allow such attachments would allow a user to subvert the
process and gain elevated privileges.

set-user-ID $B$b$7$/$O(B set-group-ID $B%P%$%J%j$+$i%W%m%;%9$,<B9T$5$l$?>l9g(B,
$B$=$N%W%m%;%9$K$O%G%P%C%0MQ%U%C%/$,@_Dj$G$-$J$/$J$j$^$9(B.
$B$=$N$h$&$J%U%C%/$N@_Dj$,2DG=$@$H(B, $B$=$N%W%m%;%9$r0-MQ$7$F(B
$B%f!<%6$,9b$$8"8B$rF@$k$3$H$,$G$-$k4m81@-$,$"$k$+$i$G$9(B.


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

A race condition exists in the FreeBSD exec system call
implementation.  It is possible for a user to attach a debugger to a
process while it is exec'ing, but before the kernel has determined
that the process is set-user-ID or set-group-ID.

FreeBSD $B$N(B exec $B%7%9%F%`%3!<%k$N<BAu$K$O(B, exec $B$N=hM}Cf(B,
$B%W%m%;%9$,(B set-user-ID $B$b$7$/$O(B set-group-ID $B$5$l$F$$$k$+$I$&$+(B
$B%+!<%M%k$,H=CG$9$kA0$K(B, $B%f!<%6$+$i$=$N%W%m%;%9$K%G%P%C%,$r(B
$B@\B3$G$-$k$h$&$J6%9g>uBV$,B8:_$7$^$9(B.

All versions of FreeBSD 4.x prior to FreeBSD 4.5-RELEASE are
vulnerable to this problem.  The problem has been corrected by marking
processes that have started but not yet completed exec with an
`in-exec' state.  Attempts to debug a process in the in-exec state
will fail.

FreeBSD 4.5-RELEASE $B$h$jA0$N$9$Y$F$N(B FreeBSD 4.x $B$,(B
$B$3$NLdBj$N1F6A$r<u$1$^$9(B.  $B$3$NLdBj$N=$@5$O(B, $B%W%m%;%9$N5/F08e(B
exec $B$,40N;$7$F$$$J$$>uBV$r(B `in-exec' $B>uBV$HDj5A$9$k$3$H$G(B
$B9T$J$o$l$^$7$?(B.  $B$D$^$j(B `in-exec' $B>uBV$N%W%m%;%9$KBP$9$k(B
$B%G%P%C%0A`:n$O$G$-$J$$$h$&$K$J$C$F$$$^$9(B.


III. $B1F6AHO0O(B - Impact

Local users may be able to gain increased privileges on the local
system.

$B%m!<%+%k%f!<%6$O(B, $B%m!<%+%k%7%9%F%`$K$*$1$k9b$$8"8B$rIT@5$K(B
$BF@$k$3$H$,$G$-$k2DG=@-$,$"$j$^$9(B.


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

None.  Do not allow untrusted users to gain access to the local
system.

$B$"$j$^$;$s(B.  $B?.Mj$G$-$J$$%f!<%6$,%m!<%+%k%7%9%F%`$K(B
$B%"%/%;%9$G$-$J$$$h$&$K$7$F$/$@$5$$(B.


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

$B<!$N$$$:$l$+$K=>$C$F$/$@$5$$(B.

1) Upgrade your vulnerable FreeBSD system to 4.4-STABLE, or the
RELENG_4_3 or RELENG_4_4 security branch, dated after the respective
correction date.
1) $B<eE@$r;}$C$?(B FreeBSD $B%7%9%F%`$r(B, $B$=$l$>$l=$@5F|0J9_$N(B
   4.4-STABLE, $B$b$7$/$O(B RELENG_4_3, RELENG_4_4 $B%;%-%e%j%F%#%V%i%s%A(B
   $B$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 following location:
a) $B=$@5%Q%C%A$r<!$N>l=j$+$i%@%&%s%m!<%I$7$^$9(B.

[FreeBSD 4.4-STABLE, or RELENG_4_3 and RELENG_4_4 security branches]
[FreeBSD 4.4-STABLE, $B$b$7$/$O(B RELENG_4_3, RELENG_4_4 $B%;%-%e%j%F%#%V%i%s%AMQ(B]

ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:08/exec.patch
ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:08/exec.patch.asc

[FreeBSD 4.3-RELEASE only]
[FreeBSD 4.3-RELEASE $BMQ(B]

ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:08/exec-43R.patch
ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:08/exec-43R.patch.asc

b) Verify the detached PGP signature using your PGP utility.
b) PGP $B%f!<%F%#%j%F%#$r;H$C$F(B PGP $B=pL>$r3NG'$7$^$9(B.

c) Execute the following commands as root:
c) root $B8"8B$G0J2<$N%3%^%s%I$r<B9T$7$^$9(B.

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

Recompile your kernel as described in
http://www.freebsd.org/handbook/kernelconfig.html
and reboot the system.

$B$=$7$F(B
http://www.freebsd.org/handbook/kernelconfig.html
$B$K=q$+$l$F$$$k<j=g$K$7$?$,$C$F%+!<%M%k$r:F9=C[$7(B,
$B%7%9%F%`$r:F5/F0$7$F$/$@$5$$(B.

3) FreeBSD 4.4-RELEASE $B%7%9%F%`$N>l9g(B:

An experimental upgrade package is available for users who wish to
provide testing and feedback on the binary upgrade process.  This
package may be installed on FreeBSD 4.4-RELEASE systems only, and is
intended for use on systems for which source patching is not practical
or convenient.

$B<B83E*$J$b$N$G$9$,(B, $B%"%C%W%0%l!<%I%Q%C%1!<%8$,MQ0U$5$l$F$$$^$9(B.
$B$3$l$O%P%$%J%j%"%C%W%0%l!<%I5!G=$N;n83$*$h$S(B, $B$=$l$KBP$9$k0U8+$r(B
$BDs6!$7$F$$$?$@$1$k%f!<%68~$1$N$b$N$G$9(B.  $B$3$N%Q%C%1!<%8$O(B
FreeBSD 4.4-RELEASE $B%7%9%F%`$K$N$_%$%s%9%H!<%k2DG=$G(B, $B%=!<%9$X(B
$B=$@5%Q%C%A$rE,MQ$9$k$3$H$,8=<BE*$G$J$+$C$?$j(B, $B$=$&$9$k$3$H$,(B
$B$U$5$o$7$/$J$$$H9M$($i$l$k%7%9%F%`$G$NMxMQ$r9MN8$7$?$b$N$G$9(B.

If you use the upgrade package, feedback (positive or negative) to
security-officer@FreeBSD.org is requested so we can improve the
process for future advisories.

$B$3$N%"%C%W%0%l!<%I%Q%C%1!<%8$rMxMQ$9$k>l9g$O(B, $B>-Mh$N%;%-%e%j%F%#4+9p$r(B
$B$h$jNI$$$b$N$K$9$k$?$a(B, ($B9NDjE*!&H]DjE*$N$$$:$l$G$"$C$F$b(B)
security-officer@FreeBSD.org $B$^$G$40U8+$r$*4s$;$/$@$5$$(B.  

Since this vulnerability involves the FreeBSD kernel which is often
locally customized on installed systems, a universal binary upgrade
package is not feasible.  This package includes a patched version of
the GENERIC kernel which should be suitable for use on many systems.
Systems requiring a customized kernel must use an alternative
solution.

$B$3$N%;%-%e%j%F%#>e$N<eE@$O(B FreeBSD $B%+!<%M%k$K4X78$7$F$$$^$9(B.  $B$7$+$7(B,
$B%+!<%M%k$O%$%s%9%H!<%k$5$l$F$$$k%7%9%F%`Kh$K%+%9%?%^%$%:$5$l$F$$$k$3$H$,(B
$BB?$/(B, $BHFMQ$N%P%$%J%j%"%C%W%0%l!<%I%Q%C%1!<%8$r:n@.$9$k$3$H$OIT2DG=$G$9(B.
$B$3$N%Q%C%1!<%8$K$O(B, $BB?$/$N%7%9%F%`$GMxMQ$G$-$k(B GENERIC $B%+!<%M%k$K(B
$B=$@5%Q%C%A$rE,MQ$7$?$b$N$r<}O?$7$F$$$^$9(B.  $B%+%9%?%^%$%:$5$l$?%+!<%M%k$,(B
$BI,MW$J>l9g$K$O(B, $B0[$J$k<jCJ$rMQ$$$F$/$@$5$$(B.

During the installation procedure, backup copies are made of the files
which are replaced by the package.  These backup copies will be
reinstalled if the package is removed, reverting the system to a
pre-patched state.

$B%$%s%9%H!<%k=hM}$NESCf$G(B, $B%"%C%W%0%l!<%I%Q%C%1!<%8$O(B
$BCV$-49$($k%U%!%$%k$N%P%C%/%"%C%W%3%T!<$r:n@.$7$^$9(B.  
$B%"%C%W%0%l!<%I%Q%C%1!<%8$,:o=|$5$l$?;~(B, $B$3$N%P%C%/%"%C%W%3%T!<$O(B
$B:F%$%s%9%H!<%k$5$l$F%7%9%F%`$O=$@5%Q%C%A$rE,MQ$9$kA0$N>uBV$KLa$j$^$9(B.

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-02:08/security-patch-exec-02.08.tgz
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/packages/SA-02:08/security-patch-exec-02.08.tgz.asc

PGP $B%f!<%F%#%j%F%#$r;H$C$F(B PGP $B=pL>$r3NG'$7$^$9(B.

# pkg_add security-patch-exec-02.08.tgz

The new kernel is named /kernel.GENERIC to avoid conflict with the
default kernel name (``/kernel'').  To cause the system to boot
automatically with the new kernel, add the following line to
/boot/loader.conf:

$B?7$7$$%+!<%M%k$NL>A0$O(B, $BI8=`$N%+!<%M%kL>(B (``/kernel'') $B$H>WFM$7$J$$$h$&$K(B
/kernel.GENERIC $B$H$$$&L>A0$K$J$C$F$$$^$9(B.  $B%7%9%F%`$r?7$7$$%+!<%M%k$G(B
$B<+F0E*$K5/F0$9$k$h$&$K@_Dj$9$k$K$O(B, $B<!$N9T(B

kernel="/kernel.GENERIC"

and reboot the system to load the new kernel.  The old kernel is still
available and can be manually loaded in the boot loader in case of
problems.

$B$r(B /boot/loader.conf $B$KDI2C$7$F:F5/F0$7$F$/$@$5$$(B.  $B?7$7$$%+!<%M%k$K(B
$BLdBj$,$"$k>l9g$O(B, $B8E$$%+!<%M%k$r%V!<%H%m!<%@$+$i<jF0$G%m!<%I$9$k$3$H$,(B
$B2DG=$G$9(B.


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

The following list contains the $FreeBSD$ revision number of the
files that were corrected in the FreeBSD source.

$B<!$NI=$O(B, $B:#2s=$@5$5$l$?(B FreeBSD $B$N%=!<%9%U%!%$%k$N(B
$FreeBSD$ $B%j%S%8%g%sHV9f$G$9(B.

Path                                                             Revision
$B%Q%9L>(B                                                          $B%j%S%8%g%s(B
  Branch
  $B%V%i%s%A(B
- -------------------------------------------------------------------------
src/sys/conf/newvers.sh
  RELENG_4_4                                                1.44.2.17.2.5
  RELENG_4_3                                               1.44.2.14.2.14
src/sys/kern/kern_exec.c
  RELENG_4                                                     1.107.2.13
  RELENG_4_4                                                1.107.2.8.2.1
  RELENG_4_3                                                1.107.2.5.2.2
src/sys/kern/sys_process.c
  RELENG_4                                                       1.51.2.3
  RELENG_4_4                                                 1.51.2.1.4.1
  RELENG_4_3                                                 1.51.2.1.2.1
src/sys/miscfs/procfs/procfs.h
  RELENG_4                                                       1.32.2.3
  RELENG_4_4                                                 1.32.2.2.2.1
  RELENG_4_3                                                 1.32.2.1.2.2
src/sys/miscfs/procfs/procfs_ctl.c
  RELENG_4                                                       1.20.2.2
  RELENG_4_4                                                 1.20.2.1.4.1
  RELENG_4_3                                                 1.20.2.1.2.1
src/sys/miscfs/procfs/procfs_dbregs.c
  RELENG_4                                                        1.4.2.3
  RELENG_4_4                                                  1.4.2.2.2.1
  RELENG_4_3                                                  1.4.2.1.2.1
src/sys/miscfs/procfs/procfs_fpregs.c
  RELENG_4                                                       1.11.2.3
  RELENG_4_4                                                 1.11.2.2.2.1
  RELENG_4_3                                                 1.11.2.1.2.1
src/sys/miscfs/procfs/procfs_mem.c
  RELENG_4                                                       1.46.2.3
  RELENG_4_4                                                 1.46.2.2.2.1
  RELENG_4_3                                                 1.46.2.1.2.2
src/sys/miscfs/procfs/procfs_regs.c
  RELENG_4                                                       1.10.2.3
  RELENG_4_4                                                 1.10.2.2.2.1
  RELENG_4_3                                                 1.10.2.1.2.1
src/sys/miscfs/procfs/procfs_status.c
  RELENG_4                                                       1.20.2.4
  RELENG_4_4                                                 1.20.2.3.4.1
  RELENG_4_3                                                 1.20.2.3.2.1
src/sys/miscfs/procfs/procfs_vnops.c
  RELENG_4                                                       1.76.2.7
  RELENG_4_4                                                 1.76.2.5.2.1
  RELENG_4_3                                                 1.76.2.3.2.2
src/sys/sys/proc.h
  RELENG_4                                                       1.99.2.6
  RELENG_4_4                                                 1.99.2.5.4.1
  RELENG_4_3                                                 1.99.2.5.2.1
- -------------------------------------------------------------------------


VII. $B;29M;qNA(B - References

<URL:ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2002-001.txt.asc>


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(B.  $B2a5n$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$?$@$7(B, $BK]Lu<T$*$h$S(B doc-jp $B$O(B, $B$=$NFbMF$K$D$$$F$$$+$J$kJ]>Z$b(B
$B$$$?$7$^$;$s$N$G$4Cm0U$/$@$5$$(B.  $BF|K\8lLu$K$D$$$F$N$40U8+(B, $B$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(B, $B$^$:$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^$`(B, $B%_%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:08,v 1.1 2002/01/25 06:36:19 hrs Exp $

----Next_Part(Fri_Jan_25_15:46:48_2002_829)----
