From nobody Tue Jan 16 20:16:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TF0dD4kJTz57xwW; Tue, 16 Jan 2024 20:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TF0dD4G7xz44Qy; Tue, 16 Jan 2024 20:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705436160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGbZGqLntCP2qz99QMCGYJC8TVlOK6ywnyNjtEJ2Lis=; b=XUPTFktAGKC5JUiBt22fqRJ+oj8R4plQSkeig1PZVxciMRi3QdUwbGDRTOQ++OvfsTaQu7 iyv21U6PuvWV3XxDRZ+Qmzpnuzk3jakNoo6BRB94Zxmi6Uvxo7aO5MtY4uAJCAFxTVumxV ol0SMHlZ5asr7cujniy8lGTUdO9fiMJATFGGJ0ih5ht02kalz3tChJ26bsVFff6mVI/n/J JkfQDf4Z2FFhxzyk/0d7nX0tQ5T5OP6iU0/uQagysZJrN9LKlearcm22r+at0ZYG7VvAtt brdP7Rt4P1Vv2VD4lAlGifqAk7sesKmADAYYjK+2WUQjiFIwjleU/5Cu8RUstA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705436160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dGbZGqLntCP2qz99QMCGYJC8TVlOK6ywnyNjtEJ2Lis=; b=LQGpMEERUdUTO1EiR24fVCmL6kn+koZb41FemUlFSdu/0aCXIFf2xAMibTzu+Qo/fgFJCA m4jNjaI5EyCb31+AfOl0HUtUwHxD4VwPixBpE2vwdbRb5oUKpbLCrUQb2e6DONjGrtWEUI I+/ahMQxhvQQz3kaOyFR/Jvbb3d0TyQjFHZSZGcB38VNzOeuOTumOzQ/6cCRkSitydgSt7 wU95v7zpHrWgnGyq2c0hAiQj1SprQPHWE/Y9qs+1PWW1NtZWNVNsI/dsQ5D5oKOWmQVtJ6 9gYRuBxFhjfZQPZ3J1SlnDpby1SmPfeljoZLutJS56lVJcIHiOe4KMCA5Bfhmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705436160; a=rsa-sha256; cv=none; b=opEslaYMvfvAATGuqD5LgtSMaEeEHDNlTHGvZM6blNlZjCrlHAPpuz+XY8U7LpS+O974oV g9GasKlFrT7SHoMjalXqzVXM7AfxEUhHmSXhXQgeKfis4BxDTmg5DdUP6rmBPfSkomJwFK 2L2Hu6+VUIRAOPJ59vKJfgLgy0xEmMEowhyNPJPDmW5d+M9/5KqYieiX4wPJZdH+nUl35p ueywvAqrsHw+ucsId+5Vbj9yuql1/bRBVlAyaqGsz0jrzGAGrvKzw3sdf/239iecVn9RLX OwQiqP2ICYEoFJrqc6yuVKdUsCCDaBXAg6IfKcGbEvvQDUZgqVDsMMLIT3X2Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TF0dD3FBbzvH0; Tue, 16 Jan 2024 20:16:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GKG0p8028204; Tue, 16 Jan 2024 20:16:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GKG019028201; Tue, 16 Jan 2024 20:16:00 GMT (envelope-from git) Date: Tue, 16 Jan 2024 20:16:00 GMT Message-Id: <202401162016.40GKG019028201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 38f5f2a4af5d - main - sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8 commit 38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8 Author: Konstantin Belousov AuthorDate: 2024-01-13 01:46:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-16 20:15:39 +0000 sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed Reported by: Shawn Webb via markj Reviewed by: jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/vm/vm_object.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 1dd6878cf4ab..905df5454355 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -2515,6 +2516,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) { /* @@ -2533,6 +2535,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; @@ -2584,7 +2587,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) {