diff mbox series

[v4,38/45] linux-user/aarch64: Verify extra record lock succeeded

Message ID 20220628042117.368549-39-richard.henderson@linaro.org
State Superseded
Headers show
Series target/arm: Scalable Matrix Extension | expand

Commit Message

Richard Henderson June 28, 2022, 4:21 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/aarch64/signal.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Peter Maydell July 4, 2022, 12:11 p.m. UTC | #1
On Tue, 28 Jun 2022 at 06:05, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  linux-user/aarch64/signal.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c
> index 8fbe98d72f..9ff79da4be 100644
> --- a/linux-user/aarch64/signal.c
> +++ b/linux-user/aarch64/signal.c
> @@ -340,6 +340,9 @@ static int target_restore_sigframe(CPUARMState *env,
>              __get_user(extra_size,
>                         &((struct target_extra_context *)ctx)->size);
>              extra = lock_user(VERIFY_READ, extra_datap, extra_size, 0);
> +            if (!extra) {
> +                return 1;
> +            }
>              break;
>
>          default:
> --

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox series

Patch

diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c
index 8fbe98d72f..9ff79da4be 100644
--- a/linux-user/aarch64/signal.c
+++ b/linux-user/aarch64/signal.c
@@ -340,6 +340,9 @@  static int target_restore_sigframe(CPUARMState *env,
             __get_user(extra_size,
                        &((struct target_extra_context *)ctx)->size);
             extra = lock_user(VERIFY_READ, extra_datap, extra_size, 0);
+            if (!extra) {
+                return 1;
+            }
             break;
 
         default: