发布时间 :2004-12-06 00:00:00
修订时间 :2016-10-17 22:47:03

[原文]The tcp_find_option function of the netfilter subsystem in Linux kernel 2.6, when using iptables and TCP options rules, allows remote attackers to cause a denial of service (CPU consumption by infinite loop) via a large option length that produces a negative integer after a casting operation to the char type.

[CNNVD]Linux Kernel IPTables符号错误远程拒绝服务漏洞(CNNVD-200412-018)

        此漏洞只有当在netfilter防火墙子系统中使用"-p tcp --tcp-option"选项时才会被触发。问题存在于tcp_find_option()函数中(net/ipv4/netfilter/ip_tables.c),定义的'opt'字段如下:
         char opt[60 - sizeof(struct tcphdr)];

- CVSS (基础分值)

CVSS分值: 5 [中等(MEDIUM)]
机密性影响: [--]
完整性影响: [--]
可用性影响: [--]
攻击复杂度: [--]
攻击向量: [--]
身份认证: [--]

- CPE (受影响的平台与产品)

cpe:/o:conectiva:linux:10Conectiva Conectiva Linux 10
cpe:/o:suse:suse_linux:8.0SuSE SuSE Linux 8.0
cpe:/o:linux:linux_kernel:2.6.0Linux Kernel 2.6.0
cpe:/o:suse:suse_linux:8.1SuSE SuSE Linux 8.1
cpe:/o:suse:suse_linux:9.0SuSE SuSE Linux 9.0
cpe:/o:gentoo:linuxGentoo Linux
cpe:/o:suse:suse_linux:8.2SuSE SuSE Linux 8.2
cpe:/o:suse:suse_linux:9.1SuSE SuSE Linux 9.1

- OVAL (用于检测的技术细节)


- 官方数据库链接
(官方数据源) MITRE
(官方数据源) NVD
(官方数据源) CNNVD

- 其它链接及资源
(UNKNOWN)  BUGTRAQ  20040630 Remote DoS vulnerability in Linux kernel 2.6.x
(VENDOR_ADVISORY)  XF  linux-tcpfindoption-dos(16554)

- 漏洞信息

Linux Kernel IPTables符号错误远程拒绝服务漏洞
中危 其他
2004-12-06 00:00:00 2005-10-20 00:00:00
        此漏洞只有当在netfilter防火墙子系统中使用"-p tcp --tcp-option"选项时才会被触发。问题存在于tcp_find_option()函数中(net/ipv4/netfilter/ip_tables.c),定义的'opt'字段如下:
         char opt[60 - sizeof(struct tcphdr)];

- 公告与补丁


- 漏洞信息 (F33705)

200420kernel.txt (PacketStormID:F33705)
2004-07-02 00:00:00

SuSE Security Announcement - A problem exists in the Linux kernel 2.4 and 2.6 series where missing Discretionary Access Control (DAC) in the chown(2) system call allow an attacker with a local account the ability to change the group ownership of arbitrary files.



                        SUSE Security Announcement

        Package:                kernel
        Announcement-ID:        SUSE-SA:2004:020
        Date:                   Tuesday, Jul 2nd 2004 18:00 MEST
        Affected products:      8.0, 8.1, 8.2, 9.0, 9.1
                                SUSE Linux Database Server,
                                SUSE eMail Server III, 3.1
                                SUSE Linux Enterprise Server 7, 8
                                SUSE Linux Firewall on CD/Admin host
                                SUSE Linux Connectivity Server
                                SUSE Linux Office Server
        Vulnerability Type:     local privilege escalation
        Severity (1-10):        6
        SUSE default package:   yes
        Cross References:	CAN-2004-0495

    Content of this advisory:
        1) security vulnerability resolved:
		- chown: users can change the group affiliation of arbitrary
		  files to the group they belong to
		- missing DAC check in chown(2): local privilege escalation
	        - overflow with signals: local denial-of-service
        	- pss, mpu401 sound driver: read/write to complete memory
	        - airo driver: read/write to complete memory
        	- ALSA: copy_from_user/copy_to_user confused
        	- acpi_asus: read from random memory
        	- decnet: write to memory without checking
        	- e1000 driver: read complete memory
           problem description, discussion, solution and upgrade information
        2) pending vulnerabilities, solutions, workarounds:
		- icecast
                - sitecopy
                - cadaver
                - OpenOffice_org
                - tripwire
                - postgresql*
                - mod_proxy
		- freeswan
		- ipsec-tools
		- less
		- libpng
		- pavuk
		- XFree86*
		- kdebase3
        3) standard appendix (further information)


1)  problem description, brief discussion, solution, upgrade information

    Multiple security vulnerabilities are being addressed with this security
    update of the Linux kernel.

    Kernel memory access vulnerabilities are fixed in the e1000, decnet, 
    acpi_asus, alsa, airo/WLAN, pss and mpu401 drivers. These 
    vulnerabilities can lead to kernel memory read access, write access 
    and local denial of service conditions, resulting in access to the 
    root account for an attacker with a local account on the affected 

    Missing Discretionary Access Control (DAC) checks in the chown(2) system
    call allow an attacker with a local account to change the group
    ownership of arbitrary files, which leads to root privileges on affected
    systems. It is specific to kernel version 2.6 based systems such as 
    the SUSE Linux 9.1 product, that only local shell access is needed to 
    exploit this vulnerability. An interesting variant of the missing 
    checks is that the ownership of files in the /proc filesystem can be 
    altered, while the changed ownership still does not allow the files to 
    be accessed as a non-root user for to be able to exploit the 
    vulnerability. Systems that are based on a version 2.4 kernel are not 
    vulnerable to the /proc weakness, and exploitation of the weakness 
    requires the use of the kernel NFS server (knfsd). If the knfsd NFS 
    server is not activated (it is off by default), the vulnerability is 
    not exposed. These issues related to the chown(2) system call have been 
    discovered by Michael Schroeder and Ruediger Oertel, both SUSE LINUX.

    The only network-related vulnerability fixed with the kernel updates
    that are subject to this announcement affect the SUSE Linux 9.1 
    distribution only, as it is based on a 2.6 kernel. Found and reported 
    to bugtraq by Adam Osuchowski and Tomasz Dubinski, the vulnerability 
    allows a remote attacker to send a specially crafted TCP packet to a 
    vulnerable system, causing that system to stall if it makes use of 
    TCP option matching netfilter rules.

    In some rare configurations of the SUSE Linux 9.1 distribution, some 
    users have experienced stalling systems during system startup. These 
    problems are fixed with this kernel update.

    For the impatient: Run YOU (Yast2 Online Update, command 
    "yast2 online_update" as root) to install the updates (semi) 
    automatically, if you have a SUSE Linux 8.1 and newer system.

    For those who wish to install their kernel updates manually and for 
    those who use a SUSE Linux 8.0 system:

    The following paragraphs will guide you through the installation
    process in a step-by-step fashion. The character sequence "****"
    marks the beginning of a new paragraph. In some cases, the steps
    outlined in a particular paragraph may or may not be applicable
    to your situation.
    Therefore, please make sure to read through all of the steps below
    before attempting any of these procedures.
    All of the commands that need to be executed are required to be
    run as the superuser (root). Each step relies on the steps before
    it to complete successfully.

  **** Step 1: Determine the needed kernel type

    Please use the following command to find the kernel type that is
    installed on your system:

      rpm -qf /boot/vmlinuz

    Following are the possible kernel types (disregard the version and
    build number following the name separated by the "-" character)

      k_deflt   # default kernel, good for most systems.
      k_i386    # kernel for older processors and chipsets
      k_athlon  # kernel made specifically for AMD Athlon(tm) family processors
      k_psmp    # kernel for Pentium-I dual processor systems
      k_smp     # kernel for SMP systems (Pentium-II and above)
      k_smp4G   # kernel for SMP systems which supports a maximum of 4G of RAM

  **** Step 2: Download the package for your system

    Please download the kernel RPM package for your distribution with the
    name as indicated by Step 1. The list of all kernel rpm packages is
    appended below. Note: The kernel-source package does not
    contain a binary kernel in bootable form. Instead, it contains the
    sources that the binary kernel rpm packages are created from. It can be
    used by administrators who have decided to build their own kernel.
    Since the kernel-source.rpm is an installable (compiled) package that
    contains sources for the linux kernel, it is not the source RPM for
    the kernel RPM binary packages.

    The kernel RPM binary packages for the distributions can be found at the
    locations below


    After downloading the kernel RPM package for your system, you should
    verify the authenticity of the kernel rpm package using the methods as
    listed in section 3) of each SUSE Security Announcement.

  **** Step 3: Installing your kernel rpm package

    Install the rpm package that you have downloaded in Steps 3 or 4 with
    the command
        rpm -Uhv --nodeps --force <K_FILE.RPM>
    where <K_FILE.RPM> is the name of the rpm package that you downloaded.

    Warning: After performing this step, your system will likely not be
             able to boot if the following steps have not been fully

    If you run SUSE LINUX 8.1 and haven't applied the kernel update
    (SUSE-SA:2003:034), AND you are using the freeswan package, you also
    need to update the freeswan rpm as a dependency as offered
    by YOU (YaST Online Update). The package can be downloaded from

  **** Step 4: configuring and creating the initrd

    The initrd is a ramdisk that is loaded into the memory of your
    system together with the kernel boot image by the bootloader. The
    kernel uses the content of this ramdisk to execute commands that must
    be run before the kernel can mount its actual root filesystem. It is
    usually used to initialize SCSI drivers or NIC drivers for diskless

    The variable INITRD_MODULES in /etc/sysconfig/kernel determines
    which kernel modules will be loaded in the initrd before the kernel
    has mounted its actual root filesystem. The variable should contain
    your SCSI adapter (if any) or filesystem driver modules.

    With the installation of the new kernel, the initrd has to be
    re-packed with the update kernel modules. Please run the command


    as root to create a new init ramdisk (initrd) for your system.
    On SuSE Linux 8.1 and later, this is done automatically when the
    RPM is installed.

  **** Step 5: bootloader

    If you run a SUSE LINUX 8.x, SLES8, or SUSE LINUX 9.x system, there
    are two options:
    Depending on your software configuration, you have either the lilo
    bootloader or the grub bootloader installed and initialized on your
    The grub bootloader does not require any further actions to be
    performed after the new kernel images have been moved in place by the
    rpm Update command.
    If you have a lilo bootloader installed and initialized, then the lilo
    program must be run as root. Use the command

      grep LOADER_TYPE /etc/sysconfig/bootloader

    to find out which boot loader is configured. If it is lilo, then you
    must run the lilo command as root. If grub is listed, then your system
    does not require any bootloader initialization.

    Warning: An improperly installed bootloader may render your system

  **** Step 6: reboot

    If all of the steps above have been successfully completed on your
    system, then the new kernel including the kernel modules and the
    initrd should be ready to boot. The system needs to be rebooted for
    the changes to become active. Please make sure that all steps have
    completed, then reboot using the command
        shutdown -r now
        init 6

    Your system should now shut down and reboot with the new kernel.

    There is no workaround known.

    Please download the update package for your distribution and verify its
    integrity by the methods listed in section 3) of this announcement.
    Then, install the package using the command "rpm -Fhv file.rpm" to apply
    the update.
    Our maintenance customers are being notified individually. The packages
    are being offered to install from the maintenance web.

    x86 Platform:

    SUSE Linux 9.1:
    source rpm(s):

    SUSE Linux 9.0:
    source rpm(s):

    SUSE Linux 8.2:
    source rpm(s):

    SUSE Linux 8.1:
    source rpm(s):

    SUSE Linux 8.0:
    source rpm(s):

    x86-64 Platform:

    SUSE Linux 9.1:
    source rpm(s):

    SUSE Linux 9.0:
    source rpm(s):


2)  Pending vulnerabilities in SUSE Distributions and Workarounds:

    - icecast
    The icecast service is vulnerable to a remote denial-of-service
    attack. Update packages will be available soon.

    - sitecopy
    The sitecopy package includes a vulnerable version of the
    neon library (CAN-2004-0179, CAN-2004-0398). Update packages will be
    available soon.

    - cadaver
    The cadaver package includes a vulnerable version of the
    neon library (CAN-2004-0179, CAN-2004-0398). Update packages will be
    available soon.

    - OpenOffice_org
    The OpenOffice_org package includes a vulnerable version
    of the neon library (CAN-2004-0179, CAN-2004-0398). Update packages
    will be available soon.

    - tripwire
    A format string bug in tripwire can be exploited locally
    to gain root permissions.
    New packages are available.

    - postgresql
    A buffer overflow in psqlODBC could be exploited to crash the
    application using it. E.g. a PHP script that uses ODBC to access a
    PostgreSQL database can be utilized to crash the surrounding Apache
    web-server. Other parts of PostgreSQL are not affected.
    New packages are available.

    - XDM/XFree86
    This update resolves random listening to ports by XDM
    that allows to connect via the XDMCP. SUSE LINUX 9.1
    is affected only.
    New packages are available.

    - mod_proxy
    A buffer overflow can be triggered by malicious remote
    servers that return a negative Content-Length value.
    This vulnerability can be used to execute commands remotely
    New packages are available.

    - freeswan
    A bug in the certificate chain authentication code could allow an
    attacker to authenticate any host against a FreeS/WAN server by
    presenting specially crafted certificates wrapped in a PKCS#7 file.
    The packages are currently being tested and will be available soon.

    - ipsec-tools
    The racoon daemon which is responsible for handling IKE messages
    fails to reject invalid or self-signed X.509 certificates which
    allows for man-in-the-middle attacks on IPsec tunnels established
    via racoon.
    The packages are currently being tested and will be available soon.

    - less
    This update fixes a possible symlink attack in The
    attack can be executed by local users to overwrite arbitrary files
    with the privileges of the user running less.
    New packages are available.

    - libpng
    This update adds a missing fix for CAN-2002-1363.
    New packages are available.

    - pavuk
    This update fixes a remotely exploitable buffer overflow in pavuk.
    Thanks to Ulf Harnhammar for reporting this to us.
    New packages are available.

    - kdebase3
    This update fixes a possible attack on tmp files created at the
    first login of a user using KDE or at the first time running a
    KDE application. This bug can be exploited locally to overwrite
    arbitrary files with the privilege of the victim user.
    Just affects SUSE LINUX 9.1
    New packages are available.


3)  standard appendix: authenticity verification, additional information

  - Package authenticity verification:

    SUSE update packages are available on many mirror ftp servers around
    the world. While this service is considered valuable and important
    to the free and open source software community, many users wish to be
    certain as to be the origin of the package and its content before
    installing the package. There are two independent verification methods
    that can be used to prove the authenticity of a downloaded file or
    rpm package:
    1) md5sums as provided in the (cryptographically signed) announcement.
    2) using the internal gpg signatures of the rpm package.

    1) execute the command
        md5sum <name-of-the-file.rpm>
       after you have downloaded the file from a SUSE ftp server or its
       mirrors. Then, compare the resulting md5sum with the one that is
       listed in the announcement. Since the announcement containing the
       checksums is cryptographically signed (usually using the key, the checksums offer proof of the authenticity
       of the package.
       We recommend against subscribing to security lists which cause the
       email message containing the announcement to be modified so that
       the signature does not match after transport through the mailing
       list software.
       Downsides: You must be able to verify the authenticity of the
       announcement in the first place. If RPM packages are being rebuilt
       and a new version of a package is published on the ftp server, all
       md5 sums for the files are useless.

    2) rpm package signatures provide an easy way to verify the authenticity
       of an rpm package. Use the command
        rpm -v --checksig <file.rpm>
       to verify the signature of the package, where <file.rpm> is the
       filename of the rpm package that you have downloaded. Of course,
       package authenticity verification can only target an un-installed rpm
       package file.
        a) gpg is installed
        b) The package is signed using a certain key. The public part of this
           key must be installed by the gpg program in the directory
           ~/.gnupg/ under the user's home directory who performs the
           signature verification (usually root). You can import the key
           that is used by SUSE in rpm packages for SUSE Linux by saving
           this announcement to a file ("announcement.txt") and
           running the command (do "su -" to be root):
            gpg --batch; gpg < announcement.txt | gpg --import
           SUSE Linux distributions version 7.1 and thereafter install the
           key "" upon installation or upgrade, provided that
           the package gpg is installed. The file containing the public key
           is placed at the top-level directory of the first CD (pubring.gpg)
           and at .

  - SUSE runs two security mailing lists to which any interested party may
        -   general/linux/SUSE security discussion.
            All SUSE security announcements are sent to this list.
            To subscribe, send an email to
        -   SUSE's announce-only mailing list.
            Only SUSE's security announcements are sent to this list.
            To subscribe, send an email to

    For general information or the frequently asked questions (faq)
    send mail to:
        <> or
        <> respectively.

    SUSE's security contact is <> or <>.
    The <> public key is listed below.

    The information in this advisory may be distributed or reproduced,
    provided that the advisory is not modified in any way. In particular,
    it is desired that the clear-text signature must show proof of the
    authenticity of the text.
    SUSE Linux AG makes no warranties of any kind whatsoever with respect
    to the information contained in this security advisory.

Type Bits/KeyID    Date       User ID
pub  2048R/3D25D3D9 1999-03-06 SuSE Security Team <>
pub  1024D/9C800ACA 2000-10-19 SuSE Package Signing Key <>

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see


- -- 
 -                                                                      -
| Roman Drahtm    

- 漏洞信息 (F33693)

HexView Security Advisory 2004-06-30.2 (PacketStormID:F33693)
2004-06-30 00:00:00
advisory,denial of service,kernel,tcp

Sending crafted packets to a 2.6 series kernel with netfilter rules matching TCP options (using the --tcp-option match) may result in a Denial of Service.

Date: Wed, 30 Jun 2004 12:57:17 +0200
From: Adam Osuchowski <>
Subject: Remote DoS vulnerability in Linux kernel 2.6.x

1. Overview

There is a remotely exploitable bug in all Linux kernel 2.6 series due to
using incorrect variable type. Vulnerability is connected to netfilter
subsystem and may cause DoS. It's disclosed only when using iptables with
rules matching TCP options (i.e.  --tcp-option). There is no difference
what action is taking up by matching rule.

Vulnerability was detected on i386 architecture. The other ones weren't tested
but it seems to be vulnerable too.

2. Details

Problem lies in tcp_find_option() function (net/ipv4/netfilter/ip_tables.c).
There is local array `opt' defined as:

    char opt[60 - sizeof(struct tcphdr)];

which contains TCP options extracted from packet. Function mentioned above
searches for specified option in this array.

Options in TCP packet, with some exceptions, are organized in the following

	Octet no.	Length	Field
		0	1	Opcode
		1	1	Length of all option (N + 2)
		2	N	Params

The function iterates over options in array:

    for (i = 0; i < optlen; ) {
	    if (opt[i] == option) return !invert;
	    if (opt[i] < 2) i++;
	    else i += opt[i+1]?:1;

moving counter by the option length.

But, in case the `length' value is greater than 127, the value of this octet
in `opt' is implicitly casted to char, which results in negative number and
the loop counter moving back. In some cases it is possible, that counter
cycles throught the contents of this array infinitely.

3. Impact

After sending one suitably prepared TCP packet to victim host, kernel goes
into infinite loop consuming all CPU resources, rendering the box
unresponsable. Of course, there is no need to have a shell access to attacked

4. Exploitation

Example of packet-of-death:

0x0000:  4500 0030 1234 4000 ff06 e83f c0a8 0001
0x0010:  c0a8 0002 0400 1000 0000 0064 0000 0064
0x0020:  7000 0fa0 dc6a 0000 0204 05b4 0101 04fd

5. Fix

There is only need to change type of `opt' array from signed char to unsigned
(or, better to u_int8_t) as it was defined in 2.4 kernel or prior to version
1.16 of net/ipv4/netfilter/ip_tables.c file.

--- net/ipv4/netfilter/ip_tables.c.orig	2004-04-04 05:36:47.000000000 +0200
+++ net/ipv4/netfilter/ip_tables.c	2004-06-24 21:24:26.000000000 +0200
@@ -1461,7 +1461,7 @@
 		int *hotdrop)
 	/* tcp.doff is only 4 bits, ie. max 15 * 4 bytes */
-	char opt[60 - sizeof(struct tcphdr)];
+	u_int8_t opt[60 - sizeof(struct tcphdr)];
 	unsigned int i;
 	duprintf("tcp_match: finding option\n");

6. Credits

Vulnerability was discovered, identified and fixed by Adam Osuchowski
and Tomasz Dubinski.

##  Adam Osuchowski,
##  Silesian University of Technology, Computer Centre   Gliwice, Poland

- 漏洞信息

Linux Kernel Netfilter TCP Option Matching DoS
Remote / Network Access Denial of Service
Loss of Availability
Exploit Public

- 漏洞描述

The Linux kernel contains a flaw that may allow a remote denial of service. The issue is triggered when using iptables to match against TCP options (--tcp-option) due to an incorrect variable type in the tcp_find_option() function of ip_tables.c. If a packet is received with a large TCP header length, it will be converted into a negative value, causing an infinite loop that uses all of the CPU time and will result in loss of availability for the platform.

- 时间线

2004-06-30 Unknow
2004-06-30 Unknow

- 解决方案

Currently, there are no known workarounds or upgrades to correct this issue. However, Adam Osuchowski has released an unofficial patch to address this vulnerability. Additionally, several Linux distributions have released updates that contain a patch for the vulnerability.

- 相关参考

- 漏洞作者

- 漏洞信息

Linux Kernel IPTables Sign Error Denial Of Service Vulnerability
Failure to Handle Exceptional Conditions 10634
Yes No
2004-06-30 12:00:00 2009-07-12 05:16:00
Discovery of this issue is credited to Adam Osuchowski <>.

- 受影响的程序版本

SuSE SUSE Linux Enterprise Server 8
+ Linux kernel 2.4.21
+ Linux kernel 2.4.19
SuSE SUSE Linux Enterprise Server 7
+ Linux kernel 2.4.19
S.u.S.E. SuSE eMail Server III
S.u.S.E. SuSE eMail Server 3.1
S.u.S.E. Office Server
S.u.S.E. Linux Personal 9.1
S.u.S.E. Linux Personal 9.0 x86_64
S.u.S.E. Linux Personal 9.0
S.u.S.E. Linux Personal 8.2
S.u.S.E. Linux Office Server
S.u.S.E. Linux Firewall on CD
S.u.S.E. Linux Database Server 0
S.u.S.E. Linux Connectivity Server
S.u.S.E. Linux Admin-CD for Firewall
S.u.S.E. Linux 8.1
S.u.S.E. Linux 8.0 i386
S.u.S.E. Linux 8.0
Linux kernel 2.6.7 rc1
Linux kernel 2.6.7
Linux kernel 2.6.6 rc1
Linux kernel 2.6.6
Linux kernel 2.6.5
+ S.u.S.E. Linux Enterprise Server 9
+ S.u.S.E. Linux Personal 9.1 x86_64
+ S.u.S.E. Linux Personal 9.1 x86_64
+ S.u.S.E. Linux Personal 9.1
+ S.u.S.E. Linux Personal 9.1
Linux kernel 2.6.4
Linux kernel 2.6.3
Linux kernel 2.6.2
Linux kernel 2.6.1 -rc2
Linux kernel 2.6.1 -rc1
Linux kernel 2.6.1
Linux kernel 2.6
Gentoo Linux 1.4

- 漏洞讨论

It has been reported that the Linux kernel is affected by a denial of service vulnerability in the iptables implementation. This issue is due to a failure of iptables to handle certain TCP packet header values.

An attacker can exploit this issue to cause the iptables implementation to consume all CPU resources due to an infinite loop, denying service to legitimate users.

- 漏洞利用

No exploit is required to leverage this issue. The following packet configuration has been reported to be sufficient to leverage this issue:

0x0000: 4500 0030 1234 4000 ff06 e83f c0a8 0001
0x0010: c0a8 0002 0400 1000 0000 0064 0000 0064
0x0020: 7000 0fa0 dc6a 0000 0204 05b4 0101 04fd

- 解决方案

Red Hat Fedora Linux has released advisory FEDORA-2004-202 along with fixes dealing with this issue. Please see the referenced advisory for more information.

SUSE has released advisory SUSE-SA:2004:020 to address this and other issues. Please see the referenced advisory for further information and fixes.

Gentoo Linux has released advisory GLSA 200407-12 to address this issue. Please see the referenced advisory for further details regarding obtaining and applying appropriate fixes.

Conectiva Linux has released advisory CLA-2004:852 along with fixes dealing with this and other issues. Please see the referenced advisory for more information.

Currently we are not aware of any vendor-supplied patches for this issue. If you feel we are in error or are aware of more recent information, please mail us at: <>.

Linux kernel 2.6.5

Linux kernel 2.6.6

- 相关参考