Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 In order to prevent uninitialized v...



details:   https://anonhg.NetBSD.org/src/rev/6e336b9d4623
branches:  trunk
changeset: 1023841:6e336b9d4623
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Sep 27 17:37:59 2021 +0000

description:
In order to prevent uninitialized values from being reflected in the registers after syscall, rval[] must be initialized.

diffstat:

 sys/arch/aarch64/aarch64/syscall.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 6d20e97fb1d6 -r 6e336b9d4623 sys/arch/aarch64/aarch64/syscall.c
--- a/sys/arch/aarch64/aarch64/syscall.c        Mon Sep 27 17:33:07 2021 +0000
+++ b/sys/arch/aarch64/aarch64/syscall.c        Mon Sep 27 17:37:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.c,v 1.8 2021/09/23 15:19:03 ryo Exp $  */
+/*     $NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 #define EMULNAME(x)    (x)
 #define EMULNAMEU(x)   (x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.8 2021/09/23 15:19:03 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -192,6 +192,8 @@
                params = args;
        }
 
+       rval[0] = 0;
+       rval[1] = tf->tf_reg[1];
        error = sy_invoke(callp, l, params, rval, code);
 
        if (__predict_true(error == 0)) {



Home | Main Index | Thread Index | Old Index