1 2 3 4 5 6 7 8 9 10 | 1: int main() 2: { 3: char *ptr; 4: int i; 5: char *x = malloc(8); 6: char c = *(x+8); //buffer overlow 7: free(x); 8: c = *x; //read free memory 9: return 0; 10: } |
1 2 3 4 5 6 7 8 9 | Error #1: UNADDRESSABLE ACCESS: reading 0x0804a020-0x0804a021 1 byte(s) # 0 t!main [/home/DrMem/t.c:9] # 1 libc.so.6<nosyms>!? # 2 t!_start Note: elapsed time = 0:00:00.133 in thread 13971 Note: refers to 1 byte(s) beyond last valid byte in prior malloc Note: prev lower malloc: 0x0804a018-0x0804a020 Note: instruction: movzx (%eax) -> %eax |
1 2 3 4 5 6 7 8 9 | Error #2: UNADDRESSABLE ACCESS: reading 0x0804a018-0x0804a019 1 byte(s) # 0 t!main [/home/DrMem/t.c:13] # 1 libc.so.6<nosyms>!? # 2 t!_start Note: elapsed time = 0:00:01.159 in thread 16384 Note: 0x0804a018-0x0804a019 overlaps memory 0x0804a018-0x0804a020 that was freed Note: instruction: movzx (%eax) -> %eax |
1 | drmemory.pl –delay_fress_stack -- ./t |
1 2 3 4 5 6 7 8 9 10 11 12 13 | Error #2: UNADDRESSABLE ACCESS: reading 0x0804a018-0x0804a019 1 byte(s) # 0 t!main [/home/DrMem/t.c:13] # 1 libc.so.6<nosyms>!? # 2 t!_start Note: elapsed time = 0:00:01.176 in thread 24378 Note: 0x0804a018-0x0804a019 overlaps memory 0x0804a018-0x0804a020 that was freed here: Note: # 0 t!main [/homeDrMem/t.c:13] Note: # 1 libc.so.6<nosyms>!? Note: # 2 t!_start Note: instruction: movzx (%eax) -> %eax |
1 2 3 4 5 6 7 8 9 10 | drmemory.pl –delay_fress_stack -- ./t 。。。 Error #3: UNADDRESSABLE ACCESS: reading 1 byte(s) # 0 t!main [/home/DrMem/t.c:14] # 1 libc.so.6<nosyms>!? # 2 t!_start Note: refers to memory that was freed here: Note: # 0 t!main [/home/DrMem/t.c:14] Note: # 1 libc.so.6<nosyms>!? Note: # 2 t!_start |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |