aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-05-09 09:37:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-01 15:12:53 +0800
commita35021b41669bd9d067e87c27115fb18de2a6834 (patch)
tree107f58fc830bfa9eb4cd9564b78e262a1d372e73 /drivers/misc/sgi-gru
parent3505c3cdccba113bd2e01c8703ec70c069f36c07 (diff)
downloadkernel_samsung_smdk4412-a35021b41669bd9d067e87c27115fb18de2a6834.tar.gz
kernel_samsung_smdk4412-a35021b41669bd9d067e87c27115fb18de2a6834.tar.bz2
kernel_samsung_smdk4412-a35021b41669bd9d067e87c27115fb18de2a6834.zip
s390/pfault: fix task state race
commit d5e50a51ccbda36b379aba9d1131a852eb908dda upstream. When setting the current task state to TASK_UNINTERRUPTIBLE this can race with a different cpu. The other cpu could set the task state after it inspected it (while it was still TASK_RUNNING) to TASK_RUNNING which would change the state from TASK_UNINTERRUPTIBLE to TASK_RUNNING again. This race was always present in the pfault interrupt code but didn't cause anything harmful before commit f2db2e6c "[S390] pfault: cpu hotplug vs missing completion interrupts" which relied on the fact that after setting the task state to TASK_UNINTERRUPTIBLE the task would really sleep. Since this is not necessarily the case the result may be a list corruption of the pfault_list or, as observed, a use-after-free bug while trying to access the task_struct of a task which terminated itself already. To fix this, we need to get a reference of the affected task when receiving the initial pfault interrupt and add special handling if we receive yet another initial pfault interrupt when the task is already enqueued in the pfault list. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru')
0 files changed, 0 insertions, 0 deletions