Function for corrupted kernel package

I am currently testing a kernel tracking mechanism (e.g. dump_stack and frame_unwind). I want to know if the kernel tracking engine can get backtracking again if the kernel stack is damaged. If not, what will be the result in this case. Please suggest me a way so that I can damage the kernel stack by writing a function (which I will insert in some kernel execution path) or a module.

+3
source share
2 answers

Other:

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

How about this:

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

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

Source: https://habr.com/ru/post/1768020/


All Articles