FreeBSD Security Advisory FreeBSD-SA-01:42.signal [REVISED]

FreeBSD Security Advisories security-advisories at
Mon Aug 6 14:47:22 PDT 2001


FreeBSD-SA-01:42                                           Security Advisory
                                                                FreeBSD, Inc.

Topic:          signal handling during exec may allow local root

Category:       core
Module:         kernel
Announced:      2001-07-10
Revised:        2001-08-06
Credits:        Georgi Guninski <guninski at>
Affects:        All released versions of FreeBSD 4.x,
                FreeBSD 4.3-STABLE prior to the correction date.
Corrected:      2001-07-09
FreeBSD only:   Yes

0.   Revision History

2001-07-10  v1.0  Initial release
2001-08-06  v1.1  Binary upgrade package available

I.   Background

When a process forks, it inherits the parent's signals.  When the
process execs, the kernel clears the signal handlers because they are
not valid in the new address space.

II.  Problem Description

A flaw exists in FreeBSD signal handler clearing that would allow for
some signal handlers to remain in effect after the exec.  Most of the
signals were cleared, but some signal hanlders were not.  This allowed
an attacker to execute arbitrary code in the context of a setuid

All versions of 4.x prior to the correction date including and
4.3-RELEASE are vulnerable to this problem.  The problem has been
corrected by copying the inherited signal handlers and resetting the
signals instead of sharing the signal handlers.

III. Impact

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

IV.  Workaround

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

V.   Solution

One of the following:

1) Upgrade your vulnerable FreeBSD system to 4.3-STABLE after the
correction date.

2) To patch your present system: download the relevant patch from the
below location, and execute the following commands as root:

[FreeBSD 4.1, 4.2, and 4.3 base systems]

This patch has been verified to apply to FreeBSD 4.1, 4.2, and 4.3 only.
It may or may not apply to older releases.

# fetch
# fetch

Verify the detached PGP signature using your PGP utility.

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

[ Recompile your kernel as described in and reboot the
system ]

3) FreeBSD 4.3-RELEASE systems:

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.3-RELEASE systems only, and is
intended for use on systems for which source patching is not practical
or convenient.

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

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

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.

# fetch
# fetch

Verify the detached PGP signature using your PGP utility.

# pkg_add security-patch-signal-01.42.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


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
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see


This is the moderated mailing list freebsd-announce.
The list contains announcements of new FreeBSD capabilities,
important events and project milestones.
See also the FreeBSD Web pages at

To Unsubscribe: send mail to majordomo at
with "unsubscribe freebsd-announce" in the body of the message

More information about the freebsd-announce mailing list