You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AddressSanitizer save a &flag[pos] in the end of FakeStack, which can be rewrite by users. If you run this code snippet with -fsanitize=address, you would get SEGV signal. Because AddressSanitizer try to read &flag[pos] in __asan_stack_free, but it reads wrong place.
struct BigData {
int x[1000];
};
void *test() {
struct BigData x;
int *y = x.x + 1032;
for (int i = 0; i < 5000; i++)
y[i] = 0xffffffff;
return &x;
}
int main() {
*(int *)test() = 1;
return 0;
}
You should compile this program with clang -fsanitize=address source.c -o a.out. I'm using v18.1.6 to do this experiment.
The text was updated successfully, but these errors were encountered:
AddressSanitizer save a &flag[pos] in the end of FakeStack, which can be rewrite by users. If you run this code snippet with
-fsanitize=address
, you would get SEGV signal. Because AddressSanitizer try to read &flag[pos] in __asan_stack_free, but it reads wrong place.You should compile this program with
clang -fsanitize=address source.c -o a.out
. I'm using v18.1.6 to do this experiment.The text was updated successfully, but these errors were encountered: