diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 34d2de1ee875..6da30800896e 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -2559,6 +2560,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) vm_page_t m; u_long sp; int count, error; + bool want_path; if (req->oldptr == NULL) { /* @@ -2577,6 +2579,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) count * 11 / 10)); } + want_path = !(swap_only || jailed(curthread->td_ucred)); kvo = malloc(sizeof(*kvo), M_TEMP, M_WAITOK | M_ZERO); error = 0; @@ -2628,7 +2631,8 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) freepath = NULL; fullpath = ""; vp = NULL; - kvo->kvo_type = vm_object_kvme_type(obj, swap_only ? NULL : &vp); + kvo->kvo_type = vm_object_kvme_type(obj, want_path ? &vp : + NULL); if (vp != NULL) { vref(vp); } else if ((obj->flags & OBJ_ANON) != 0) {