Question about kernel stack When a process is created by fork(), kernel calls do_fork().
do_fork() calls copy_process()
and a union thread_union is created in the kernel memory space.
union thread_union {
struct thread_info thread_info;
unsigned long stack[THREAD_SIZE/sizeof(long)];
}
Usually, on IA32 the size of thread_union is 8KB.
On some special machine architecture, the size is 4KB.
| 8K| kernel stack
| . . | |
| . . | V
| . . |------------------------
| . . |
| . . |-----------------------
| 0. | thread info
I wonder what kind of data will be put in the kernel stack. Since it only has a space of 8KB or 4KB, a rather small number, will there be a risk that the stack overflows? |