From nobody Wed Jan 24 13:04:25 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 4TKkgY6Zj8z58DCq; Wed, 24 Jan 2024 13:04:25 +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 4TKkgY65Lfz4W7y; Wed, 24 Jan 2024 13:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706101465; 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=FXarlPDbG12rBEBJvJxExANZKtdcPMQZjFoa+JNZ6Yk=; b=sWXO77yqDPbHJQwppLcprnal88wrauttW9eT711nfp8x20kBzL7zGsl64EUaB5iIsz5wIR H4aOiitlYMLISJblAiUS9AEa3vPptMyeRwVmS9uFyDbW4+Yg8wq5vUhVth+P24MVNnq+Iv YI9QsiLChgnoO8E0UD1ATSmypYuMSWJUo1IOa3HqF6wFAYAE0yL6U7ZmSZ5oCuagaaKLcC MFtnQm3G+dUcgZ3rSDg1jcwM0hL0vHjbLjvHZXxENCRr/wZvEXx73+F3uauNYIse34gTOk JNJDYrWg2ihUnqeAftOwEwRHfxvi6lBIRrk7MtSGgOGjRNAAYkOcVKL0CUwvOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706101465; 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=FXarlPDbG12rBEBJvJxExANZKtdcPMQZjFoa+JNZ6Yk=; b=pPNFkNwR9JIQeGRA0FcRt0ek4Se2TRksokR9HewX1MyiKzl1+x7PLVJADfalHMBnKE+J+U hKJ/jyNyz3DqCpqPPIebHGG+VdP8m9uab/YlU8TBRKsG+Y3i0k907zuRat9JuAH5++DjM2 lI2TZGS66oUFAv2GN3m96S5x+RBa7uHKk4V1biw+wfvv9tuvax+xjuRlupuyuCWrU7wGSQ 0gPYfTX1jLTbLo3JA1QTQ3kdWwYEfDxlzQHL9E0LvfsOJfuk1egA7I+axt9i1x8LA1jDro bGZX4F+dtvwFr5AVAIcpsZh+fCfMnSO+qAv3eWgKyZUGBaOseHBLB7xYdFsM2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706101465; a=rsa-sha256; cv=none; b=DRoYf4laVJn9jiMaOCucQnV8DuxDKAf92ApyHfhJ8hXyoKN+o8miLL4qyy7yZ0SOQDEeno tKalm+gRIE3hYaKPtCWA41gjwogkMnpo+odBMDHNzCNeJwFfcgMzwdvrYryOM26vYY9Koi dc2ZWjsqaTUFZqCVNmwiBwW03JP8SYkk+n4PSuFlsZIjX1tQu2SNC41lPXpXYQVP8fliAv DCqLhBju9siq+FLKf/qfrLdgeCVYuqFMPAc74IFM1cleF+8TwqmRvg3SmlZeBOXbhVsAKw IXDoU65mhaI4EPu/8dgAmV9Byn3/FtopVsfxFijvim6cUgHzyxNWIRpx27761Q== 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 4TKkgY57R6zFRr; Wed, 24 Jan 2024 13:04:25 +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 40OD4PMo032829; Wed, 24 Jan 2024 13:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40OD4P7u032827; Wed, 24 Jan 2024 13:04:25 GMT (envelope-from git) Date: Wed, 24 Jan 2024 13:04:25 GMT Message-Id: <202401241304.40OD4P7u032827@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: 8788c3d3fa9d - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 8788c3d3fa9d217e0b4f2bb87a84fbd6e6aceac9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8788c3d3fa9d217e0b4f2bb87a84fbd6e6aceac9 commit 8788c3d3fa9d217e0b4f2bb87a84fbd6e6aceac9 Author: Konstantin Belousov AuthorDate: 2024-01-13 01:46:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-24 13:04:07 +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 d3337c038113..76ae6118a756 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -2516,6 +2517,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) { /* @@ -2534,6 +2536,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; @@ -2585,7 +2588,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) {