qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 08/13] signal/all/do_sigreturn - remove __get


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 08/13] signal/all/do_sigreturn - remove __get_user checks
Date: Sat, 7 Jun 2014 22:34:42 +0100

On 6 June 2014 10:46,  <address@hidden> wrote:
> From: Riku Voipio <address@hidden>
>
> Remove "if(__get_user" checks and their related error paths
> for all architecture's do_sigreturn. Remove the unlock_user_struct
> when the only way to end up there is from failed lock_user_struct.
>
> Signed-off-by: Riku Voipio <address@hidden>
> ---
>  linux-user/signal.c | 62 
> +++++++++++++++++------------------------------------
>  1 file changed, 20 insertions(+), 42 deletions(-)
>
> diff --git a/linux-user/signal.c b/linux-user/signal.c
> index 56d6e29..8edf1f9 100644
> --- a/linux-user/signal.c
> +++ b/linux-user/signal.c
> @@ -1094,13 +1094,11 @@ long do_sigreturn(CPUX86State *env)
>      fprintf(stderr, "do_sigreturn\n");
>  #endif
>      if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1))
> -        goto badframe;
> +        goto sigsegv;

This change (and the extra sigsegv: label) aren't necessary --
lock_user/unlock_user are written so that if the former fails
it will set the host-pointer variable to NULL, and the latter will
do nothing if handed a NULL host-pointer.

thanks
-- PMM



reply via email to

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