aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.ibm.com>2019-06-03 17:55:15 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-06-04 13:33:23 +1000
commit2d4c7f9886ee45f7c1db933885e5002b76c270ad (patch)
treeb0ea683d6845687b59d4c452c704a993e2aaad3c /core
parenta66f5a81000dd8efcdcae8f4a996e185d0701c49 (diff)
downloadskiboot-2d4c7f9886ee45f7c1db933885e5002b76c270ad.zip
skiboot-2d4c7f9886ee45f7c1db933885e5002b76c270ad.tar.gz
skiboot-2d4c7f9886ee45f7c1db933885e5002b76c270ad.tar.bz2
core/cpu: Fix theoretical use-after-free if no_return job returns
Practically speaking this should/would never happen, but static analysis caught it, and just *maybe* at some time in the future, someone will have less of a terrible day debugging something terrible if we fix it. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/cpu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/cpu.c b/core/cpu.c
index 168a49a..54111a9 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -361,8 +361,12 @@ void cpu_process_jobs(void)
free(job);
func(data);
if (!list_empty(&cpu->locks_held)) {
- prlog(PR_ERR, "OPAL job %s returning with locks held\n",
- job->name);
+ if (no_return)
+ prlog(PR_ERR, "OPAL no-return job returned with"
+ "locks held!\n");
+ else
+ prlog(PR_ERR, "OPAL job %s returning with locks held\n",
+ job->name);
drop_my_locks(true);
}
lock(&cpu->job_lock);