git: 4c20e26e26ec - stable/13 - syscalls: fix modspecific_t stack content leak

From: Ka Ho Ng <khng_at_FreeBSD.org>
Date: Tue, 04 Jul 2023 12:41:30 UTC
The branch stable/13 has been updated by khng:

URL: https://cgit.FreeBSD.org/src/commit/?id=4c20e26e26ec33664475900de028c9e77bffd8bf

commit 4c20e26e26ec33664475900de028c9e77bffd8bf
Author:     Ka Ho Ng <khng@FreeBSD.org>
AuthorDate: 2023-06-27 19:33:46 +0000
Commit:     Ka Ho Ng <khng@FreeBSD.org>
CommitDate: 2023-07-04 12:41:07 +0000

    syscalls: fix modspecific_t stack content leak
    
    Zero-initialize the whole modspecific_t so that there would
    not be kernel stack content leak in the unused part.
    
    Sponsored by:   Juniper Networks, Inc.
    Differential Revision:  https://reviews.freebsd.org/D40815
    
    (cherry picked from commit 2cab2d43b83bddd44ecc1f267afb5e2725975ac7)
---
 sys/kern/kern_syscalls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/kern_syscalls.c b/sys/kern/kern_syscalls.c
index b4fec879708a..fa1df225ee3b 100644
--- a/sys/kern/kern_syscalls.c
+++ b/sys/kern/kern_syscalls.c
@@ -173,7 +173,7 @@ kern_syscall_module_handler(struct sysent *sysents, struct module *mod,
     int what, void *arg)
 {
 	struct syscall_module_data *data = arg;
-	modspecific_t ms;
+	modspecific_t ms = { 0 };
 	int error;
 
 	switch (what) {