Fix race condition in KfRaiseIrql().
After getting the current irql, if the kthread gets preempted and subsequently runs on a different CPU, the saved irql could be wrong. Also, correct the panic string. PR: kern/165630 Submitted by: Vladislav Movchan <vladislav.movchan at gmail.com>
This commit is contained in:
parent
4a63252f49
commit
03225fac13
@ -392,16 +392,18 @@ KfRaiseIrql(uint8_t irql)
|
||||
{
|
||||
uint8_t oldirql;
|
||||
|
||||
sched_pin();
|
||||
oldirql = KeGetCurrentIrql();
|
||||
|
||||
/* I am so going to hell for this. */
|
||||
if (oldirql > irql)
|
||||
panic("IRQL_NOT_LESS_THAN");
|
||||
panic("IRQL_NOT_LESS_THAN_OR_EQUAL");
|
||||
|
||||
if (oldirql != DISPATCH_LEVEL) {
|
||||
sched_pin();
|
||||
if (oldirql != DISPATCH_LEVEL)
|
||||
mtx_lock(&disp_lock[curthread->td_oncpu]);
|
||||
}
|
||||
else
|
||||
sched_unpin();
|
||||
|
||||
/*printf("RAISE IRQL: %d %d\n", irql, oldirql);*/
|
||||
|
||||
return (oldirql);
|
||||
|
Loading…
x
Reference in New Issue
Block a user