qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 05/11] linux-user/sh4: Notice gUSA regions durin


From: John Paul Adrian Glaubitz
Subject: Re: [Qemu-devel] [PATCH 05/11] linux-user/sh4: Notice gUSA regions during signal delivery
Date: Thu, 6 Jul 2017 14:55:02 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

Le 06/07/2017 à 02:23, Richard Henderson a écrit :
> kernel also checks PC < gUSA region end point,
> try this:
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index 1e716a9..4e1e4f0 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -3477,7 +3477,8 @@ static abi_ulong get_sigframe(struct
> target_sigaction *ka,
>  static void unwind_gusa(CPUSH4State *regs)
>  {
>      /* If the stack pointer is sufficiently negative... */
> -    if ((regs->gregs[15] & 0xc0000000u) == 0xc0000000u) {
> +    if ((regs->gregs[15] & 0xc0000000u) == 0xc0000000u &&
> +        regs->pc < regs->gregs[0]) {
>          /* Reset the PC to before the gUSA region, as computed from
>             R0 = region end, SP = -(region size), plus one more insn
>             that actually sets SP to the region size.  */

This fixes the segfaults for me with newer chroots.

So, just in case:

Tested-By: John Paul Adrian Glaubitz <address@hidden>

Thanks,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - address@hidden
`. `'   Freie Universitaet Berlin - address@hidden
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



reply via email to

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