git: 7060c79d2403 - releng/15.0 - vm_object: Reset kvo_path on each iteration in vm_object_list_handler()

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Fri, 17 Oct 2025 17:59:36 UTC
The branch releng/15.0 has been updated by cperciva:

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

commit 7060c79d2403431940e9cc79c71959f8c0f7f6f1
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-10-10 13:26:29 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-17 17:59:00 +0000

    vm_object: Reset kvo_path on each iteration in vm_object_list_handler()
    
    Otherwise we print a bogus path for anonymous objects.
    
    Approved by:    re (cperciva)
    Reviewed by:    kib
    MFC after:      1 week
    Sponsored by:   Modirum MDPay
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D52997
    
    (cherry picked from commit 13d866b314f87df901c0a1cbbbc56d56ee0d7b7c)
    (cherry picked from commit 55ad7c573e5b7b8fa25dd368ccad1d1774c77824)
---
 sys/vm/vm_object.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 6d9ea8bf9d93..fe84523b7a8f 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -2522,15 +2522,13 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only)
 			continue;
 		}
 		mtx_unlock(&vm_object_list_mtx);
+
+		memset(kvo, 0, sizeof(*kvo));
 		kvo->kvo_size = ptoa(obj->size);
 		kvo->kvo_resident = obj->resident_page_count;
 		kvo->kvo_ref_count = obj->ref_count;
 		kvo->kvo_shadow_count = atomic_load_int(&obj->shadow_count);
 		kvo->kvo_memattr = obj->memattr;
-		kvo->kvo_active = 0;
-		kvo->kvo_inactive = 0;
-		kvo->kvo_laundry = 0;
-		kvo->kvo_flags = 0;
 		if (!swap_only) {
 			vm_page_iter_init(&pages, obj);
 			VM_RADIX_FOREACH(m, &pages) {
@@ -2552,9 +2550,6 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only)
 			}
 		}
 
-		kvo->kvo_vn_fileid = 0;
-		kvo->kvo_vn_fsid = 0;
-		kvo->kvo_vn_fsid_freebsd11 = 0;
 		freepath = NULL;
 		fullpath = "";
 		vp = NULL;