s390/pfault: add sanity check
If the task that was found on an initial interrupt doesn't match the current task execute a WARN_ON_ONCE() and don't put the task to sleep. When this happened something went wrong between the interface of the hypervisor and the kernel. In such a case keep the tasks alive to avoid a hanging system. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
0a16ba7866
commit
d49f47f83d
@ -584,6 +584,8 @@ static void pfault_interrupt(struct ext_code ext_code,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* signal bit not set -> a real page is missing. */
|
/* signal bit not set -> a real page is missing. */
|
||||||
|
if (WARN_ON_ONCE(tsk != current))
|
||||||
|
goto out;
|
||||||
if (tsk->thread.pfault_wait == 1) {
|
if (tsk->thread.pfault_wait == 1) {
|
||||||
/* Already on the list with a reference: put to sleep */
|
/* Already on the list with a reference: put to sleep */
|
||||||
__set_task_state(tsk, TASK_UNINTERRUPTIBLE);
|
__set_task_state(tsk, TASK_UNINTERRUPTIBLE);
|
||||||
@ -606,6 +608,7 @@ static void pfault_interrupt(struct ext_code ext_code,
|
|||||||
set_tsk_need_resched(tsk);
|
set_tsk_need_resched(tsk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
spin_unlock(&pfault_lock);
|
spin_unlock(&pfault_lock);
|
||||||
put_task_struct(tsk);
|
put_task_struct(tsk);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user