From nobody Wed Jan 24 13:05:09 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 4TKkhQ1X10z58Dfh; Wed, 24 Jan 2024 13:05:10 +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 4TKkhQ0v9Cz4WdX; Wed, 24 Jan 2024 13:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706101510; 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=xvHs4kPfN/R4BKg6u/Mh5GoPGcpoxjALJSpEZef9yY0=; b=QQdmw1I1oKoHDJQ7QC05F6cSTh3Z7bfZ2aE6uS9CeC4PIwRdbgnkRz6AAZKEWvkbSDWsGP up5Vq4DOMhYTYyEV+iO8ECt8dHSzukWFDH41YjOhkzpv8E1iWnnmuQAVu3MsXeN7VKMkrx kQRahnpnZ4NKS7aaYTUxgflmnWWYy00ucnd2a7s89rQhaq3OpsUiYxjwzYqYp3NxVG45G8 YwdlNOCxS1U6mq2zaucMbescU4p1f0iPIfearX29ABcplFjDoB9QONEFE3nTkt64BUMaDC 5zVQrCdfcmqDX5gw8IBqlowHE3xcxN589uVtQXheDFj/IeXZ53u0HBx1hBDT0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706101510; 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=xvHs4kPfN/R4BKg6u/Mh5GoPGcpoxjALJSpEZef9yY0=; b=CNvgTZmG8NvXung6siwPvtduXMWMX3CMjlz/sJPes1x0Ojb9Q9/yDXcBm6m+KLtf+HMuF3 cAI9BsC1J3N2T7X5kZKb8rzpjcnXBNtdpBll3ZjLu1LbzD0MDTwtPY0NeLJpxf/MCRjIMK EJEMvbggqgyRPh45DstLQrdgTuncEzrT64ip1kcv2mYeCCgQ0UzQCRC66nwD0D2r36fNal xE9/yYVlmbYGnde6r+tqatJcUoAXCV9FGYuM2TftB1bHB8pKOo1u34a8I/+D1f7dpbc2Fq YKyaIOjGCDOhWIzNa+pZm3uxPaA74y/qBLP0ywra96+4U8UmMFUdlmDVJPKgSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706101510; a=rsa-sha256; cv=none; b=LsXt5aQBkTaPdE8FeeHAqVtbasZ/mamNqhSR4xnA5dbCBqkCgGdrtjjVif1ShfbAx7Tza1 MAd+/lXkRAuUmURrS1POAp4kJU7TXCioK1EtQrsMNVXsq06ihKdHU6YXSqBeQOV4KO8nNh PuLba7+3tXjN+6QWtTCw4PbeG3kboI6lvDKkZdC+Dwf7QP1TOoJEUkDXCzzQOok5kT5PGw iaXgkW55dEdxB9ginw3XhU5pQUTOYzrPBwmjGFJTDpF3WMDPxf1z7B515IR9SX/ymAmyhY lP9PwM1ODcr+6BBiF/XCfVcqM2ngyuol1Ea6xtkZDi/3pYaQdkr38WRcM8sOog== 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 4TKkhP74SJzG8d; Wed, 24 Jan 2024 13:05:09 +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 40OD59SG033075; Wed, 24 Jan 2024 13:05:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40OD59k2033073; Wed, 24 Jan 2024 13:05:09 GMT (envelope-from git) Date: Wed, 24 Jan 2024 13:05:09 GMT Message-Id: <202401241305.40OD59k2033073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5c4e6fd30bbc - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c4e6fd30bbc859e06af1bdaa42eed32a5418b04 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4e6fd30bbc859e06af1bdaa42eed32a5418b04 commit 5c4e6fd30bbc859e06af1bdaa42eed32a5418b04 Author: Konstantin Belousov AuthorDate: 2024-01-13 01:46:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-24 13:04:38 +0000 sysctl vm.objects/vm.swap_objects: do not fill vnode info if jailed (cherry picked from commit 38f5f2a4af5daeec7f13d39cad1ff4dc90da52d8) --- 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 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) {