AUSCERT External Security Bulletin Redistribution

                  ESB-2002.343 -- FreeBSD-SA-02:30.ktrace
              Users may trace previously privileged processes
                               15 July 2002


        AusCERT Security Bulletin Summary

Product:                ktrace
Vendor:                 FreeBSD
Operating System:       FreeBSD prior to and including 4.6-RELEASE
                        FreeBSD 4.6-STABLE prior to the correction date
Impact:                 Access Privileged Data
Access Required:        Existing Account

- --------------------------BEGIN INCLUDED TEXT--------------------


FreeBSD-SA-02:30                                            Security Advisory
                                                          The FreeBSD Project

Topic:          Users may trace previously privileged processes

Category:       core
Module:         ktrace
Announced:      2002-07-12
Credits:        Theo DeRaadt <deraadt@OpenBSD.org>
                Darren Reed <darrenr@FreeBSD.org>
Affects:        All releases prior to and including 4.6-RELEASE
                FreeBSD 4.6-STABLE prior to the correction date
Corrected:      2002-07-05 22:36:38 UTC (RELENG_4)
                2002-07-11 16:47:41 UTC (RELENG_4_6)
                2002-07-11 16:47:55 UTC (RELENG_4_5)
                2002-07-11 16:56:05 UTC (RELENG_4_4)
FreeBSD only:   NO

I.   Background

The ktrace utility is a debugging tool that allows users to trace
system calls, I/O, and file system lookup operations executed by or on
behalf of a process and its children.  Since this could potentially
reveal sensitive information, the kernel will normally only allow a
user to trace his or her own processes, and will immediately stop
tracing a process that gains special privileges, for instance by
executing a setuid or setgid binary.  The ktrace utility depends on
the KTRACE kernel option, which is enabled by default.

II.  Problem Description

If a process that had special privileges were to abandon them, it
would become possible for the owner of that process to trace it.
However, that process might still possess and / or communicate
sensitive information that it had obtained before abandoning its
privileges, which would then be revealed to the tracing user.

III. Impact

In theory, local users on systems where ktrace is enabled through
the KTRACE kernel option might obtain sensitive information, such
as password files or authentication keys.  No specific utility is
currently known to be vulnerable to this particular problem.

IV.  Workaround

Recompile the kernel without the KTRACE option, and reboot.

V.   Solution

The following patch has been verified to apply to FreeBSD 4.4, 4.5, and
4.6 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-02:30/ktrace.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:30/ktrace.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

VI.  Correction details

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

Path                                                             Revision
- - -------------------------------------------------------------------------
- - -------------------------------------------------------------------------

VII. References

Version: GnuPG v1.0.7 (FreeBSD)


- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content.  The decision to use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the original authors to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:


If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security

Internet Email: auscert@auscert.org.au
Facsimile:	(07) 3365 7031
Telephone:	(07) 3365 4417 (International: +61 7 3365 4417)
		AusCERT personnel answer during Queensland business hours
		which are GMT+10:00 (AEST).
		On call after hours for member emergencies.

Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key