Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Initialize the syscall "frame" to 0 before setting ...



details:   https://anonhg.NetBSD.org/src/rev/e2892ae0eba4
branches:  trunk
changeset: 325171:e2892ae0eba4
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Dec 09 19:18:52 2013 +0000

description:
Initialize the syscall "frame" to 0 before setting parameters.
Otherwise things which treat syscall parameters as register_t (like
ktrace) will encounter garbage for parameters which are of smaller size
than register_t.  Using memset is probably not the most optimal way,
but oh well.

diffstat:

 sys/kern/makesyscalls.sh |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 773360dccf3f -r e2892ae0eba4 sys/kern/makesyscalls.sh
--- a/sys/kern/makesyscalls.sh  Mon Dec 09 18:06:27 2013 +0000
+++ b/sys/kern/makesyscalls.sh  Mon Dec 09 19:18:52 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: makesyscalls.sh,v 1.136 2013/12/09 16:32:06 pooka Exp $
+#      $NetBSD: makesyscalls.sh,v 1.137 2013/12/09 19:18:52 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -828,6 +828,7 @@
                argsize = "sizeof(callarg)"
                printf("\tstruct %s%s_args callarg;\n\n",compatwrap_,funcname) \
                    > rumpcalls
+               printf "\tmemset(&callarg, 0, sizeof(callarg));\n" > rumpcalls
                for (i = 1; i <= argc; i++) {
                        if (argname[i] == "PAD") {
                                printf("\tSPARG(&callarg, %s) = 0;\n", \



Home | Main Index | Thread Index | Old Index