Commits
Alexey Kuznetsov authored and Pavel Emelianov committed d8e8aa3f4f4
[CPT] restoring threads with tsk->fs==NULL If a nptl thread is ptraced, it does not die immediately and we can arrive to the state: parent | main_thread -----> thread1 [ptraced] in TASK_ZOMBIE in TASK_ZOMBIE To restore such configuration we do kernel_thread(CLONE_SIGNAL) in context of main_thread. But if it is exited, it has tsk->fs == NULL and kernel oopes. Suggested fix is very simple: we just attach temporary fs_struct from init task of VE. Also, we have to delay initialization of tsk->group_exit, otherwise kernel will not allow us to clone. This fix is pragmatic. Better fix would be restructuring of restore to delay zombification until the last stage of restore. I.e. we could restore all the tree of alive processes with all the attributes of alive task (fs, mm etc). And after it is complete, we could make one more pass and collect garbage killing zombie tasks and clearing fs, mm etc. It would be cleaner and safer, but requires too much of changes. (#65219)