-
-
Save moyix/ed0d6dde9bc8164ff5e58030282d72af to your computer and use it in GitHub Desktop.
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 <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
unsigned char data[258]; | |
unsigned char data2[258]; | |
strcpy(data, "averylongstringwithnotmuchmeaningaverylongstringwithnotmuchmeaning" | |
"averylongstringwithnotmuchmeaningaverylongstringwithnotmuchmeaning" | |
"averylongstringwithnotmuchmeaningaverylongstringwithnotmuchmeaning"); | |
printf("data = %p\n", data); | |
// Uncommenting these two lines will cause PANDA to see the writes in __copy_from_user_ll_nozero | |
//printf("data2 = %p\n", data2); | |
//memcpy(data2,data,258); | |
int fd = open("foo", O_CREAT|O_RDWR, 0644); | |
int n = write(fd, data, 258); | |
fsync(fd); | |
close(fd); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment