aboutsummaryrefslogtreecommitdiff
path: root/cpu-exec-common.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2017-03-20 11:31:44 +0000
committerAlex Bennée <alex.bennee@linaro.org>2017-03-28 10:50:35 +0100
commit02bed6bd5f45819f1557a4b04db300a72383ecdb (patch)
tree878016bb7d1d5aed3dba30f136eeca3cca8ccdd4 /cpu-exec-common.c
parentea2afcf5b6727a577cf561fd8fe0d8c397ecc927 (diff)
downloadqemu-02bed6bd5f45819f1557a4b04db300a72383ecdb.zip
qemu-02bed6bd5f45819f1557a4b04db300a72383ecdb.tar.gz
qemu-02bed6bd5f45819f1557a4b04db300a72383ecdb.tar.bz2
user-exec: handle synchronous signals from QEMU gracefully
When "tcg: enable thread-per-vCPU" (commit 3725794) was merged the lifetime of current_cpu was changed. Previously a broken linux-user call might abort() which can eventually escalate into a SIGSEGV which would then crash qemu as it attempted to deref a NULL current_cpu. After commit 3725794 it would attempt to fixup state and re-start the run-loop and much hilarity (i.e. a looping lockup) would ensue from jumping into a stale jmp_env. As we can actually tell if we are in the run-loop from looking at the cpu->running flag we should catch this badness first and abort() cleanly rather than try to soldier on. There is a theoretical race between the flag being set and sigsetjmp refreshing the jump buffer but we can try really hard to not introduce crashes into that code. [LV: setgroups03 fails on powerpc LTP] Reported-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpu-exec-common.c')
0 files changed, 0 insertions, 0 deletions