[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1 v2] Fix do_rt_sigreturn on m68k linux usersp
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH 1/1 v2] Fix do_rt_sigreturn on m68k linux userspace emulation |
Date: |
Sat, 12 Dec 2015 11:36:45 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
Le 12/12/2015 11:13, Michael Karcher a écrit :
> do_rt_sigreturn uses an uninitialised local variable instead of fetching
> the old signal mask directly from the signal frame when restoring the mask,
> so the signal mask is undefined after do_rt_sigreturn. As the signal
> frame data is in target-endian order, target_to_host_sigset instead of
> target_to_host_sigset_internal is required.
>
> do_sigreturn is correct in using target_to_host_sigset_internal, because
> get_user already did the endianness conversion.
>
> Signed-off-by: Michael Karcher <address@hidden>
> ---
> linux-user/signal.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index e03ed60..13f9142 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -5258,14 +5258,13 @@ long do_rt_sigreturn(CPUM68KState *env)
> {
> struct target_rt_sigframe *frame;
> abi_ulong frame_addr = env->aregs[7] - 4;
> - target_sigset_t target_set;
> sigset_t set;
> int d0;
>
> if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))
> goto badframe;
>
> - target_to_host_sigset_internal(&set, &target_set);
> + target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
> do_sigprocmask(SIG_SETMASK, &set, NULL);
>
> /* restore registers */
>
Reviewed-by: Laurent Vivier <address@hidden>
Tested-by: Laurent Vivier <address@hidden>