qemu-discuss
[Top][All Lists]
Advanced

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

Re: qemu-i386 crash on signal handler return


From: Peter Maydell
Subject: Re: qemu-i386 crash on signal handler return
Date: Sun, 2 Oct 2022 15:47:02 +0100

On Sun, 2 Oct 2022 at 04:41, Tavis Ormandy <taviso@gmail.com> wrote:
> Hello, I'm trying to use qemu-i386 on aarch64 to run an old binary and
> running into a crash.
>
> I've minimized it down to %esp getting corrupted after return from a
> signal handler return, but this seems so trivial that I must be doing
> something wrong?
>
> Here is a minimal reproducer:
>
> https://lock.cmpxchg8b.com/files/repro.s
>
> To compile it on an x86_64 machine:
>
> $ as --32 repro.s -o repro.o
> $ ld -melf_i386 repro.o -o repro
>
> # It runs totally fine on i386/x86_64:
>
> $ strace ./repro
> [ Process PID=1848 runs in 32 bit mode. ]
> sigaction(SIGALRM, {sa_handler=0x8049001, sa_mask=[],
> sa_flags=SA_INTERRUPT|SA_NODEFER|SA_RESETHAND}, NULL) = 0
> alarm(1)                                = 0
> pause()                                 = ? ERESTARTNOHAND (To be restarted 
> if no handler)
> --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
> sigreturn({mask=[]})                    = -1 EINTR (Interrupted system call)
> exit(0)                                 = ?
> +++ exited with 0 +++
>
> Now trying the same binary on aarch64:
> $ qemu-i386 -version
> qemu-i386 version 5.2.0 (Debian 1:5.2+dfsg-11+deb11u2)

5.2 is a couple of years old now -- does the same bug still repro on
7.1 or head-of-git ?

thanks
-- PMM



reply via email to

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