| 3452 | |
| 3453 | == memset DATA == |
| 3454 | * s0711489@ubuntu-lucid64:~$ sudo insmod stackmod.ko |
| 3455 | * s0711489@ubuntu-lucid64:~$ cat /sys/module/stackmod/sections/.text |
| 3456 | {{{ |
| 3457 | 0xffffffffa0068000 |
| 3458 | }}} |
| 3459 | * s0711489@ubuntu-lucid64:~$ cat /sys/module/stackmod/sections/.data |
| 3460 | {{{ |
| 3461 | 0xffffffffa0068738 |
| 3462 | }}} |
| 3463 | * s0711489@ubuntu-lucid64:~$ cat /sys/module/stackmod/sections/.bss |
| 3464 | {{{ |
| 3465 | 0xffffffffa0068970 |
| 3466 | }}} |
| 3467 | |
| 3468 | * gdb |
| 3469 | {{{ |
| 3470 | (gdb) file vmlinux |
| 3471 | Reading symbols from /home/ugrad/07/s0711489/coursework/KernelHack/linux-2.6.35.14/x86_64/vmlinux...(no debugging symbols found)...done. |
| 3472 | (gdb) add-symbol-file ../../04/stackmod/stackmod.o 0xffffffffa0068000 -s .data 0xffffffffa0068738 -s .bss 0xffffffffa0068970 |
| 3473 | add symbol table from file "../../04/stackmod/stackmod.o" at |
| 3474 | .text_addr = 0xffffffffa0068000 |
| 3475 | .data_addr = 0xffffffffa0068738 |
| 3476 | .bss_addr = 0xffffffffa0068970 |
| 3477 | (y or n) y |
| 3478 | Reading symbols from /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.o...done. |
| 3479 | (gdb) target remote localhost:8864 |
| 3480 | Remote debugging using localhost:8864 |
| 3481 | 0xffffffff810097a9 in native_safe_halt () |
| 3482 | at /home/ugrad/07/s0711489/coursework/KernelHack/linux-2.6.35.14/x86_64/arch/x86/include/asm/irqflags.h:49 |
| 3483 | 49 asm volatile("sti; hlt": : :"memory"); |
| 3484 | (gdb) b stackmod_proc_read |
| 3485 | Breakpoint 1 at 0xffffffffa00681cd: file /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c, line 153. |
| 3486 | (gdb) c |
| 3487 | Continuing. |
| 3488 | }}} |
| 3489 | |
| 3490 | * s0711489@ubuntu-lucid64:~$ cat /proc/stackmod |
| 3491 | {{{ |
| 3492 | stack: 0 |
| 3493 | }}} |
| 3494 | {{{ |
| 3495 | Breakpoint 1, stackmod_proc_read (page=0xffff88001d9bd000 "", |
| 3496 | start=0xffff88001adbbe90, off=0, count=3072, eof=0xffff88001adbbe9c, |
| 3497 | data=0x0) |
| 3498 | at /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c:153 |
| 3499 | 153 ) { |
| 3500 | (gdb) p stack |
| 3501 | $1 = {data = 0xffff88001b5fa000, depth = 0, errno = 0} |
| 3502 | (gdb) p entry |
| 3503 | $2 = 128 |
| 3504 | (gdb) p stack.data[0] |
| 3505 | $3 = {length = 0, content = 0x0} |
| 3506 | (gdb) p stack.data[127] |
| 3507 | $4 = {length = 0, content = 0x0} |
| 3508 | (gdb) p stack.data[128] |
| 3509 | $5 = {length = 459255808, content = 0x0} |
| 3510 | (gdb) c |
| 3511 | Continuing. |
| 3512 | |
| 3513 | Breakpoint 1, stackmod_proc_read (page=0xffff88001d9bd000 "stack: 0\n", |
| 3514 | start=0xffff88001adbbe90, off=9, count=3072, eof=0xffff88001adbbe9c, |
| 3515 | data=0x0) |
| 3516 | at /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c:153 |
| 3517 | 153 ) { |
| 3518 | (gdb) c |
| 3519 | Continuing. |
| 3520 | }}} |
| 3521 | |
| 3522 | * s0711489@ubuntu-lucid64:~$ cat blob > /dev/stack |
| 3523 | * s0711489@ubuntu-lucid64:~$ cat /proc/stackmod |
| 3524 | {{{ |
| 3525 | stack: 10 |
| 3526 | }}} |
| 3527 | {{{ |
| 3528 | Breakpoint 1, stackmod_proc_read (page=0xffff88001d9bd000 "stack: 0\n", |
| 3529 | start=0xffff88001adbbe90, off=0, count=3072, eof=0xffff88001adbbe9c, |
| 3530 | data=0x0) |
| 3531 | at /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c:153 |
| 3532 | 153 ) { |
| 3533 | (gdb) p stack |
| 3534 | $6 = {data = 0xffff88001b5fa000, depth = 10, errno = 0} |
| 3535 | (gdb) p stack.data[0] |
| 3536 | $7 = {length = 32768, |
| 3537 | content = 0xffff88001b9e0000 "\315̦[\371t\021\252Ď\230\311\003\240f\222\206}\363oyy\\$\276\205\271l3\033;\215\215\231m\375B\005\027|]$\375-x\374@\227\205\262\320\371z\022\342Z\351\273/\234\214\034\331\020z C\345\004\023J\024?\232\262ë\357\266xa\274l%H\264ʿ,uZ\025\373\373@^q\226z\326k\276\a6\227\r\322B\035X\303Y\364\205#β\325\342\222\301%\311]\301TR\277e\242s\276m]>\346\001\327\027J]\325\065<\212\332\037\200QFtUԴ\223q;.Y/\017ٻj\313\264\246$\254v`\241بz!`i\255Ћ\245\360\346\065\252\343\315ĤN\034\364!\324'\002\001\321P"...} |
| 3538 | (gdb) p stack.data[8] |
| 3539 | $8 = {length = 32768, |
| 3540 | content = 0xffff88001ac70000 "\377\352<e\275\025\343\"j\bc\021V\016\272\027h\244DYpo\347\215s\216\353\326\307\\\033\017\230:i}\024<n\342P\355\371\\\374\337j8\334M=m\276e\300\277dm\270SQ\\M\376\003\301\025&\203\325\034\r\361\355v\201o\303\034;M\206i\217\017w\365R\373\003+\242EN\037\327\375\353\004[\024.\f\255\234cb)\314qnR6\021\374\312\351b\252\035\232?OY\025Ǖ\347\ft\276\360\304g", <incomplete sequence \342>} |
| 3541 | (gdb) p stack.data[9] |
| 3542 | $9 = {length = 32768, |
| 3543 | content = 0xffff88001ac68000 "\266,\361\t\361\366\345\352=\247k&Ce"} |
| 3544 | (gdb) p stack.data[10] |
| 3545 | $10 = {length = 0, content = 0x0} |
| 3546 | (gdb) p stack.data[11] |
| 3547 | $11 = {length = 0, content = 0x0} |
| 3548 | (gdb) c |
| 3549 | Continuing. |
| 3550 | |
| 3551 | Breakpoint 1, stackmod_proc_read (page=0xffff88001d9bd000 "stack: 10\n", |
| 3552 | start=0xffff88001adbbe90, off=10, count=3072, eof=0xffff88001adbbe9c, |
| 3553 | data=0x0) |
| 3554 | at /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c:153 |
| 3555 | 153 ) { |
| 3556 | (gdb) c |
| 3557 | Continuing. |
| 3558 | }}} |
| 3559 | |
| 3560 | * s0711489@ubuntu-lucid64:~$ cat /dev/stack > /dev/null |
| 3561 | * s0711489@ubuntu-lucid64:~$ cat /proc/stackmod |
| 3562 | {{{ |
| 3563 | stack: 0 |
| 3564 | }}} |
| 3565 | {{{ |
| 3566 | Breakpoint 1, stackmod_proc_read (page=0xffff88001d9bd000 "stack: 10\n", |
| 3567 | start=0xffff88001b587e90, off=0, count=3072, eof=0xffff88001b587e9c, |
| 3568 | data=0x0) |
| 3569 | at /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c:153 |
| 3570 | 153 ) { |
| 3571 | (gdb) p stack |
| 3572 | $12 = {data = 0xffff88001b5fa000, depth = 0, errno = 0} |
| 3573 | (gdb) p stack.data[0] |
| 3574 | $13 = {length = 0, content = 0x0} |
| 3575 | (gdb) p stack.data[9] |
| 3576 | $14 = {length = 0, content = 0x0} |
| 3577 | (gdb) p stack.data[10] |
| 3578 | $15 = {length = 0, content = 0x0} |
| 3579 | (gdb) c |
| 3580 | Continuing. |
| 3581 | |
| 3582 | Breakpoint 1, stackmod_proc_read (page=0xffff88001d9bd000 "stack: 0\n", |
| 3583 | start=0xffff88001b587e90, off=9, count=3072, eof=0xffff88001b587e9c, |
| 3584 | data=0x0) |
| 3585 | at /home/ugrad/07/s0711489/coursework/KernelHack/04/stackmod/stackmod.c:153 |
| 3586 | 153 ) { |
| 3587 | (gdb) |
| 3588 | Continuing. |
| 3589 | }}} |