/* * If init_new_context wasn't called, this will be * zero, resulting in a kill(0), which will result in the * whole UML suddenly dying. Also, cover negative and * 1 cases, since they shouldn't happen either. * * Negative cases happen if the child died unexpectedly.
*/ if (mmu->id.pid >= 0 && mmu->id.pid < 2) {
printk(KERN_ERR "corrupt mm_context - pid = %d\n",
mmu->id.pid); return;
}
while ((pid = os_reap_child()) > 0) { /* * A child died, check if we have an MM with the PID. This is * only relevant in SECCOMP mode (as ptrace will fail anyway). * * See wait_stub_done_seccomp for more details.
*/
list_for_each_entry(mm_context, &mm_list, list) { if (mm_context->id.pid == pid) { struct stub_data *stub_data;
printk("Unexpectedly lost MM child! Affected tasks will segfault.");
/* Marks the MM as dead */
mm_context->id.pid = -1;
/* * NOTE: If SMP is implemented, a futex_wake * needs to be added here.
*/
stub_data = (void *)mm_context->id.stack;
stub_data->futex = FUTEX_IN_KERN;
/* * NOTE: Currently executing syscalls by * affected tasks may finish normally.
*/ break;
}
}
}
return IRQ_HANDLED;
}
staticint __init init_child_tracking(void)
{ int err;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.