diff options
Diffstat (limited to 'results/classifier/118/permissions/2157')
| -rw-r--r-- | results/classifier/118/permissions/2157 | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/results/classifier/118/permissions/2157 b/results/classifier/118/permissions/2157 new file mode 100644 index 000000000..97b702f96 --- /dev/null +++ b/results/classifier/118/permissions/2157 @@ -0,0 +1,73 @@ +x86: 0.971 +permissions: 0.951 +architecture: 0.930 +graphic: 0.889 +i386: 0.872 +user-level: 0.859 +device: 0.855 +performance: 0.822 +PID: 0.809 +ppc: 0.801 +files: 0.788 +kernel: 0.786 +peripherals: 0.768 +socket: 0.747 +vnc: 0.746 +network: 0.744 +register: 0.726 +hypervisor: 0.662 +VMM: 0.658 +risc-v: 0.587 +TCG: 0.583 +debug: 0.558 +semantic: 0.524 +arm: 0.523 +assembly: 0.487 +boot: 0.478 +KVM: 0.367 +mistranslation: 0.349 +virtual: 0.332 + +qemu-user fails to run 32-bit x86 binaries on hosts with a page size > 4KB +Description of problem: +`qemu-i386` refuses to run 32-bit x86 binaries on hosts with a page size > 4KB +(such as LoongArch, ppc64le, arm64 with 3 level page tables). +Steps to reproduce: +1. Compile x86 binary which makes a single exit(0) syscall: + ``` + cat > exit0.S << EOF + #include <sys/syscall.h> + .text + .global _start + _start: + movl $__NR_exit, %eax + movl $0, %ebx + int $0x80 + EOF + i586-linux-gnu-gcc -nostdlib -static -no-pie -o exit0 exit0.S + ``` + Alternatively one might compile it on a x86 host: + ``` + gcc -m32 -nostdlib -static -no-pie -o exit0 exit0.S + ``` + and transfer the `exit0` binary to ppc64/LoongArch/arm64 system + + 2. Run the `exit0` binary with `qemu-i386` + ``` + qemu-i386-static ./exit0 + ``` + + # +Additional information: +`.text` segment of (32-bit) x86 binaries is typically aligned at 4KB: +``` +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD 0x000000 0x08048000 0x08048000 0x00100 0x00100 R 0x1000 + LOAD 0x001000 0x08049000 0x08049000 0x0000c 0x0000c R E 0x1000 + NOTE 0x0000b4 0x080480b4 0x080480b4 0x0004c 0x0004c R 0x4 + GNU_PROPERTY 0x0000d8 0x080480d8 0x080480d8 0x00028 0x00028 R 0x4 +``` + +Thus on a host with a page size being 64 KB (ppc64, arm64 with 3 level page tables) or 16 KB (LoongArch) +alignment requirements in [pbg_dynamic](https://gitlab.com/qemu-project/qemu/-/blob/master/linux-user/elfload.c?ref_type=heads#L3020) can not be satisfied. |