git: f2dc387443f3 - stable/12 - vm_object: Fix a kernel memory disclosure via the vm_object list sysctl

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 23 Jan 2023 13:52:06 UTC
The branch stable/12 has been updated by markj:

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

commit f2dc387443f3c8025cc0c4bbd6cd4e6dd1c729bf
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-01-16 15:53:59 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-01-23 13:51:57 +0000

    vm_object: Fix a kernel memory disclosure via the vm_object list sysctl
    
    Reported by:    Chris J-D <chris@accessvector.net>
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit b050ee6c97e7f5b6f1e3adec69775fa41afc948f)
---
 sys/vm/vm_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 4edab2a10eef..3896f48e7a98 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2316,7 +2316,7 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS)
 		    count * 11 / 10));
 	}
 
-	kvo = malloc(sizeof(*kvo), M_TEMP, M_WAITOK);
+	kvo = malloc(sizeof(*kvo), M_TEMP, M_WAITOK | M_ZERO);
 	error = 0;
 
 	/*