开发者

Function to corrupt kernel stack

I am currently testing the kernel back tracing mechanism ( like dump_stack and frame_unwind ). I want to know whether the kernel back tracing mechanism can still give the back trace if the kernel stack got corrupted. If not, then what would be the output in that case. Please suggest me a way so that I can corrupt th开发者_运维问答e kernel stack by writing a function ( which i will embed between some kernel execution path ) or a module.


Another one:

#define VALUE 1
#define HUGESIZE 50
void overflow()
{
    char buffer[0];
    printk("Overflowing stack.. \n");
    memset(buffer, VALUE, HUGESIZE);
}


How about this:

void overflow_stack() {
    int p[1];
    int i;

    for(i = 0; i < 1024; i++) {
        p[i] = i;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜