-----BEGIN PGP SIGNED MESSAGE-----

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                 ESB-2003.0558 -- FreeBSD-SA-03:09.signal
               Insufficient range checking of signal numbers
                              11 August 2003

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:                kernel
Publisher:              FreeBSD
Operating System:       FreeBSD 4-STABLE and prior
                        FreeBSD 4.8-RELEASE-p1 and prior
                        FreeBSD 5.1-RELEASE and prior
Impact:                 Denial of Service
Access Required:        Existing Account

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

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

=============================================================================
FreeBSD-SA-03:09.signal                                     Security Advisory
                                                          The FreeBSD Project

Topic:          Insufficient range checking of signal numbers

Category:       core
Module:         sys
Announced:      2003-08-10
Affects:        All releases of FreeBSD up to and including 4.8-RELEASE-p1,
                5.1-RELEASE (but see `Problem Description' below)
                FreeBSD 4-STABLE prior to the correction date
Corrected:      2003-08-10 23:09:28 UTC (RELENG_4)
                2003-08-10 23:14:08 UTC (RELENG_5_1)
                2003-08-10 23:17:48 UTC (RELENG_5_0)
                2003-08-10 23:19:35 UTC (RELENG_4_8)
                2003-08-10 23:20:30 UTC (RELENG_4_7)
                2003-08-10 23:21:18 UTC (RELENG_4_6)
                2003-08-10 23:22:19 UTC (RELENG_4_5)
                2003-08-10 23:23:05 UTC (RELENG_4_4)
                2003-08-10 23:23:56 UTC (RELENG_4_3)
FreeBSD only:   YES

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

I.   Background

Signals are a UNIX mechanism for handling asynchronous events such as
pressing the terminal interrupt key (e.g. Ctrl-C), job control, memory
access violations, I/O completion, and many others.  Each signal is
assigned a positive number.  There are a number of mechanisms by which
a process may cause a signal to be sent, including using the kill(2)
system call or registering with certain device drivers.

II.  Problem Description

Some mechanisms for causing a signal to be sent did not properly
validate the signal number, in some cases allowing the kernel to
attempt to deliver a negative or out-of-range signal number.  Such
errors were present in the ptrace(2) system call and the `spigot'
video capture device driver.

The error in ptrace(2) was introduced in FreeBSD version 4.2-RELEASE
(4-STABLE dated Oct 26 04:34:41 2000 UTC).

The `spigot' device driver (including the error) was introduced in
FreeBSD 2.0.5.  It has never been included in the kernel installed by
default, nor in the GENERIC kernel configuration.  Only systems with
`device spigot' added to the kernel configuration are affected by this
instance of the error.

III. Impact

In most cases, attempted delivery of a negative or out-of-range signal
number will trigger an assertion failure and panic, thereby crashing
the system.  A malicious local user could use this vulnerability
as a local denial-of-service attack.

However, in FreeBSD 5.x, the assertion code is not present if the
`INVARIANTS' kernel option is not used.  In FreeBSD 5.0-RELEASE and
5.1-RELEASE, `INVARIANTS' is not enabled by default.  In this
configuration, a malicious local user could use this vulnerability
to modify kernel memory, potentially leading to complete system
compromise.  (FreeBSD 4.x is not vulnerable in this way.)

IV.  Workaround

There is no workaround for the local denial-of-service attack.

The more severe impact, present only in FreeBSD 5.x systems, can be
avoided by uncommenting or adding the `INVARIANTS' line to your kernel
configuration:

  options       INVARIANTS              #Enable calls of extra sanity checking

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

NOTE WELL:  This workaround is only for FreeBSD 5.x systems.  This
workaround does not eliminate the possibility of a local
denial-of-service attack.

V.   Solution

1) Upgrade your vulnerable system to 4.8-STABLE, or to any of the
RELENG_4_8 (4.8-RELEASE-p2), RELENG_4_7 (4.7-RELEASE-p12), or
RELENG_5_1 (5.1-RELEASE-p1) security branches dated after the
respective correction dates.

2) To patch your present system:

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 5.1-RELEASE]

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal51.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal51.patch.asc

[FreeBSD 5.0-RELEASE]

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal50.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal50.patch.asc

[FreeBSD 4.8-RELEASE, 4.8-STABLE, 4.7-STABLE dated Jan 2 20:39:13 2003 UTC
 or later]

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal4s.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal4s.patch.asc

[FreeBSD 4.3-RELEASE through 4.7-RELEASE, 4.7-STABLE dated before
 Jan 2 20:39:13 2003 UTC]

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal47.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:09/signal47.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 system.

VI.  Correction details

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

Branch                                                           Revision
  Path
- - -------------------------------------------------------------------------
src/sys/UPDATING
  RELENG_5_1                                                    1.251.2.2
  RELENG_5_0                                                   1.229.2.15
  RELENG_4_8                                                1.73.2.80.2.4
  RELENG_4_7                                               1.73.2.74.2.15
  RELENG_4_6                                               1.73.2.68.2.43
  RELENG_4_5                                               1.73.2.50.2.45
  RELENG_4_4                                               1.73.2.43.2.46
  RELENG_4_3                                               1.73.2.28.2.33
src/sys/conf/newvers.sh
  RELENG_5_1                                                     1.50.2.3
  RELENG_5_0                                                    1.48.2.10
  RELENG_4_8                                                1.44.2.29.2.3
  RELENG_4_7                                               1.44.2.26.2.14
  RELENG_4_6                                               1.44.2.23.2.32
  RELENG_4_5                                               1.44.2.20.2.29
  RELENG_4_4                                               1.44.2.17.2.37
  RELENG_4_3                                               1.44.2.14.2.23
src/sys/i386/isa/spigot.c
  RELENG_4                                                       1.44.2.1
  RELENG_5_1                                                     1.58.2.1
  RELENG_5_0                                                     1.55.2.1
  RELENG_4_8                                                    1.44.14.1
  RELENG_4_7                                                    1.44.12.1
  RELENG_4_6                                                    1.44.10.1
  RELENG_4_5                                                     1.44.8.1
  RELENG_4_4                                                     1.44.6.1
  RELENG_4_3                                                     1.44.4.1
src/sys/kern/sys_process.c
  RELENG_4                                                       1.51.2.7
  RELENG_5_1                                                    1.108.2.1
  RELENG_5_0                                                    1.104.2.1
  RELENG_4_8                                                 1.51.2.6.2.1
  RELENG_4_7                                                 1.51.2.4.2.1
  RELENG_4_6                                                 1.51.2.3.4.1
  RELENG_4_5                                                 1.51.2.3.2.1
  RELENG_4_4                                                 1.51.2.1.4.2
  RELENG_4_3                                                 1.51.2.1.2.2
src/sys/kern_sig.c
  RELENG_5_1                                                    1.239.2.1
  RELENG_5_0                                                    1.197.2.1
- - -------------------------------------------------------------------------
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE/Nt6VFdaIBMps37IRAs/0AJ9qtj0Cv+y3QjUZXrFDQx00oTv+AwCgnys1
p3OHIN16XjGz8OhmjF1nWKM=
=tnsF
- -----END PGP SIGNATURE-----

- --------------------------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 follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

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 author's website 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:

        http://www.auscert.org.au/render.html?cid=1980

If you believe that your computer system has been compromised or attacked in 
any way, we encourage you to let us know by completing the secure National IT 
Incident Reporting Form at:

        http://www.auscert.org.au/render.html?it=3192

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 only.
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQCVAwUBPzdBlyh9+71yA2DNAQHmPQQAi16a0rnJ+etfSoJXUQ5FWyq+JwZWs3lo
lCpfm0yRoX5KHyOAeXlnXLdpTM8tES6PXXMPKONLaMiwdy2sOcm3SLpI0LItQmRQ
MPXptQro3szR3m7PfLSNIrj4t3yMxdPB/v5PsGrWWecECkkWdQ7aaO5j5R1z6/eR
I90XuRS/iEI=
=MkAj
-----END PGP SIGNATURE-----