fix for race condition - IRQ can happen between clearing the endpoint
of the handling process and before removing the hook. The handler function will panic then.
This commit is contained in:
parent
ad259e92af
commit
7c0cdc61bc
1 changed files with 8 additions and 9 deletions
|
@ -56,6 +56,14 @@ register struct proc *rc; /* slot of process to clean up */
|
||||||
/* Don't clear if already cleared. */
|
/* Don't clear if already cleared. */
|
||||||
if(isemptyp(rc)) return;
|
if(isemptyp(rc)) return;
|
||||||
|
|
||||||
|
/* Check the table with IRQ hooks to see if hooks should be released. */
|
||||||
|
for (i=0; i < NR_IRQ_HOOKS; i++) {
|
||||||
|
int proc;
|
||||||
|
if (rc->p_endpoint == irq_hooks[i].proc_nr_e) {
|
||||||
|
rm_irq_handler(&irq_hooks[i]); /* remove interrupt handler */
|
||||||
|
irq_hooks[i].proc_nr_e = NONE; /* mark hook as free */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove the process' ability to send and receive messages */
|
/* Remove the process' ability to send and receive messages */
|
||||||
clear_endpoint(rc);
|
clear_endpoint(rc);
|
||||||
|
@ -69,15 +77,6 @@ register struct proc *rc; /* slot of process to clean up */
|
||||||
*/
|
*/
|
||||||
RTS_LOCK_SETFLAGS(rc, RTS_SLOT_FREE);
|
RTS_LOCK_SETFLAGS(rc, RTS_SLOT_FREE);
|
||||||
|
|
||||||
/* Check the table with IRQ hooks to see if hooks should be released. */
|
|
||||||
for (i=0; i < NR_IRQ_HOOKS; i++) {
|
|
||||||
int proc;
|
|
||||||
if (rc->p_endpoint == irq_hooks[i].proc_nr_e) {
|
|
||||||
rm_irq_handler(&irq_hooks[i]); /* remove interrupt handler */
|
|
||||||
irq_hooks[i].proc_nr_e = NONE; /* mark hook as free */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Release the process table slot. If this is a system process, also
|
/* Release the process table slot. If this is a system process, also
|
||||||
* release its privilege structure. Further cleanup is not needed at
|
* release its privilege structure. Further cleanup is not needed at
|
||||||
* this point. All important fields are reinitialized when the
|
* this point. All important fields are reinitialized when the
|
||||||
|
|
Loading…
Reference in a new issue