qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple aarch64 binary can cause linux-user QEMU to segv in zero_bss(


From: Richard Henderson
Subject: Re: simple aarch64 binary can cause linux-user QEMU to segv in zero_bss()
Date: Tue, 24 Nov 2020 09:18:12 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 11/23/20 11:52 AM, Peter Maydell wrote:
> Somebody reported this on stackoverflow. Before I spend too
> much time thinking about how this ought to work, does anybody
> have the elfload.c intended operation in their head still?
> Bug description and analysis of what goes wrong below:
> 
> https://stackoverflow.com/questions/64956322/alignment-requirements-for-arm64-elf-executables-run-in-qemu-assembled-by-gas
> 
> Given this trivial asm:
> 
> ===begin program.s===
> // GNU Assembler, ARM64 Linux
> 
> .bss
> 
> .lcomm ARRAY, 16
> 
> .text
> 
> .global _start
> 
> _start:
>     mov x8, 93 // exit sys num
>     mov x0, 0 // success
>     svc 0
> ===endit===

...

> Should we try to get the SEGV handler working earlier in initialization
> (it's pretty hairy machinery so that could be tricky) or should
> elfload.c be mprotect()ing things appropriately itself?

elfload should be handling this.

I believe this should be fixed by

20201118165206.2826-1-steplong@quicinc.com/">https://patchew.org/QEMU/20201118165206.2826-1-steplong@quicinc.com/


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]