diff options
Diffstat (limited to 'results/classifier/118/review/1815024')
| -rw-r--r-- | results/classifier/118/review/1815024 | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/results/classifier/118/review/1815024 b/results/classifier/118/review/1815024 new file mode 100644 index 000000000..fe7c5cc92 --- /dev/null +++ b/results/classifier/118/review/1815024 @@ -0,0 +1,87 @@ +architecture: 0.830 +x86: 0.667 +user-level: 0.633 +device: 0.568 +semantic: 0.558 +socket: 0.532 +vnc: 0.525 +files: 0.472 +performance: 0.466 +TCG: 0.463 +PID: 0.462 +network: 0.462 +ppc: 0.461 +register: 0.404 +graphic: 0.386 +kernel: 0.386 +permissions: 0.371 +debug: 0.369 +VMM: 0.367 +boot: 0.322 +arm: 0.303 +assembly: 0.299 +risc-v: 0.271 +hypervisor: 0.250 +peripherals: 0.205 +virtual: 0.190 +KVM: 0.167 +i386: 0.100 +mistranslation: 0.098 +-------------------- +debug: 0.707 +hypervisor: 0.076 +virtual: 0.075 +TCG: 0.069 +user-level: 0.063 +files: 0.041 +PID: 0.039 +architecture: 0.023 +assembly: 0.020 +performance: 0.014 +register: 0.013 +kernel: 0.012 +x86: 0.012 +semantic: 0.008 +network: 0.005 +device: 0.003 +peripherals: 0.002 +VMM: 0.002 +socket: 0.002 +risc-v: 0.001 +boot: 0.001 +graphic: 0.001 +ppc: 0.001 +KVM: 0.001 +permissions: 0.001 +vnc: 0.001 +i386: 0.000 +mistranslation: 0.000 +arm: 0.000 + +SIGILL on instruction "stck" under qemu-s390x in user mode + +qemu-s390x in user mode crashes with SIGILL (under host architecture x86_64, running Debian unstable) when executing target instruction "stck" ("STORE CLOCK", see https://www-01.ibm.com/support/docview.wss?uid=isg26480faec85f44e2385256d5200627dee&aid=1), which is basically a kind of equivalent of Intel "rdtsc". The same instruction works fine under qemu-s390x in system mode. The bug is reproducible with both the qemu version distributed in Debian unstable and with the latest upstream master (commit 47994e16b1d66411953623e7c0bf0cdcd50bd507). + +This bug manifested itself as a crash of ssh-keygen program, which uses "stck" to obtain some bits of randomness during key creation. Bisection of the code led to the attached minimal example. Compile with (inside an s390x system): + + $ gcc -c -o test.o test.c + $ gcc -c -o rdtsc.o rdtsc.S + $ gcc -o test test.o rdtsc.o + +Then run test. It will crash with SIGILL in user mode and run fine in system mode. Also, compare with the original file at https://github.com/openssl/openssl/blob/master/crypto/s390xcpuid.pl#L139 (there the instruction "stckf" is also used; it is probable that it has the same problem if it is supported altogether, but it did not test for this). + +Running qemu-s390x with options -d in_asm,out_asm,op,op_opt,exec,nochain,cpu gives the trace attached in log.txt. + +Thanks, Giovanni. + + + + + + + +I am also attaching the compiled program, in case it is helpful. + +Fix has been merged: +https://git.qemu.org/?p=qemu.git;a=commitdiff;h=965018bea7ce79e1987 + |