Skip to content

Commit

Permalink
s390/runtime instrumentation: fix preemption imbalance
Browse files Browse the repository at this point in the history
Commit 550435a ("s390/runtime instrumention: fix possible memory
corruption") introduced a preemption imbalance. Fix that!

That bug is not present in Linus' tree as that bug was fixed with the
rewrite in commit 8d9047f8b967 ("s390/runtime instrumentation: simplify
task exit handling"). However, that commit hasn't been backported.

Bad luck, Greg...

Found-by: Skimming over 'git diff v4.9.65..v4.9.66'
Signed-off-by: Mathias Krause <minipli@googlemail.com>
  • Loading branch information
minipli committed Dec 4, 2017
1 parent 94c4339 commit c6cc968
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/s390/kernel/runtime_instr.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ void exit_thread_runtime_instr(void)

preempt_disable();
if (!task->thread.ri_cb)
return;
goto out;
disable_runtime_instr();
kfree(task->thread.ri_cb);
task->thread.ri_cb = NULL;
out:
preempt_enable();
}

Expand Down

0 comments on commit c6cc968

Please sign in to comment.