From nobody Mon Jan 22 17:30:08 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 4TJcg46Qflz57r1N; Mon, 22 Jan 2024 17:30:08 +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 4TJcg44GnLz4fgq; Mon, 22 Jan 2024 17:30:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705944608; 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=JQ86veFXXO+w8etiFrjOoWiptnGGT1GZb/eKPoRz90o=; b=ur5ZJ47aQs1sEMD9uyhcVLZ9pPuea8dO8ib636tDB5UY6PhWl36aqorpQBCXw5JfewBGox z/wgnVL8veJQiIST5ZrmBlfirIpwgIeA0yT8ZKGNhlqFLGOYWNpCujyKAk04dV4VXfqfvj roE0UuxkJhKAvXwLivgRPy28/SMhkYqijnI1mJwtTpy31NRe8pOMmXDhorxBVGWOxx4HZ0 dpK4L7WnkGW91mEfWCdnWCaTma63uR/p0rahHKWr8rTyfPYxNhzO1dLDU9+cHU8a28lZlU lAr6u+Tx1joLDKhMwlF1hpLC+V0/j01cffJeekLwVACJ3E82U65SbnGKe9z55w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705944608; 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=JQ86veFXXO+w8etiFrjOoWiptnGGT1GZb/eKPoRz90o=; b=e/887DbLRvXHYuuSVRVekxVRV0sMsjbJdkHn/mHmTuS5EWgaaeLSRvULN7nr5GVZChaYsN AYjaVFfB+fdDPQ0A+hQqmrkDMYAyGge/15yQg1pbzdvCHv4p05NV1h0XgUvLR9Rjf1gn2p PZ54vy6uNaqRAQTzLfrh8GrbU6mPkIju0EdHhDBXyqsM/mYHzS+AJsA2insqiBT6w7r3Aw JfT5fxeUpMz4JaTRVn1LJ69Lpfsg9oQqwKEXP2+Fp6yuj52K4JCllzLim6a3FPIqVGClMM CIMUVpfEEvxdBSnw4z9T6G8xVK4EqMKJtiCNqmxFog6L1SxiS8DDxVWcTRTsYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705944608; a=rsa-sha256; cv=none; b=VC0EZzPsPZvNrpLoIdPgx4ThtHBZewQPjTW21LHvTG1rw4OY9n+SsvHNaN/ZPob4AgHUAI 5rPq/628dnRQc2FRNhY3LvhR/LOHRCIySOmavI1tYs1cL1Hmn0396hDMtFXArdnA9xtTEM jvVgYRpoyynUJwH0HqRkKrj3MS6i5FFz+gqSZFTiPudfYovqQLijxq2Qotz1Wb7RCOdxxY KkLer5V14uf1TF4MtZk+KGofQ5YCB0P9EiqmI+yl8/VhEV5eVhliM36HdmEsiNioUeFWo+ vBNFTFNRgeQgQBc261bzKuSrliZzJkvN3G4u1/mZeM9aOR+WnEQ9pyXvcVLibg== 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 4TJcg43NQQz19PW; Mon, 22 Jan 2024 17:30:08 +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 40MHU8xu010133; Mon, 22 Jan 2024 17:30:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40MHU8tS010129; Mon, 22 Jan 2024 17:30:08 GMT (envelope-from git) Date: Mon, 22 Jan 2024 17:30:08 GMT Message-Id: <202401221730.40MHU8tS010129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 6b23df1a398f - stable/13 - bhyveload: add CAP_SEEK to our dirfd rights 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b23df1a398ff29db25fc988857d846a879f277a Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6b23df1a398ff29db25fc988857d846a879f277a commit 6b23df1a398ff29db25fc988857d846a879f277a Author: Kyle Evans AuthorDate: 2024-01-09 03:08:16 +0000 Commit: Kyle Evans CommitDate: 2024-01-22 17:17:53 +0000 bhyveload: add CAP_SEEK to our dirfd rights In the case of hostbase_fd, this is infact a bug fix; we have a seek callback that the host: filesystem may use in loader, and we really don't have a good excuse to break it. bootfd-derived fds will only be used with fdlopen(3) and rtld doesn't seem to need pread / lseek at all for it today, but there's no reason to break if it finds a good reason to later. Suggested by: markj (cherry picked from commit cef5e56f3fea33d6c421276af49f2967453ad4ff) --- usr.sbin/bhyveload/bhyveload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index 0c37bd6989e4..dbc4240eaa8a 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -752,7 +752,7 @@ hostbase_open(const char *base) err(EX_OSERR, "open"); if (caph_rights_limit(hostbase_fd, cap_rights_init(&rights, CAP_FSTATAT, - CAP_LOOKUP, CAP_READ)) < 0) + CAP_LOOKUP, CAP_PREAD)) < 0) err(EX_OSERR, "caph_rights_limit"); } @@ -884,7 +884,7 @@ main(int argc, char** argv) * to the more usual lookup rights. */ if (caph_rights_limit(bootfd, cap_rights_init(&rights, - CAP_FSTATAT, CAP_LOOKUP, CAP_MMAP_RX, CAP_READ)) < 0) + CAP_FSTATAT, CAP_LOOKUP, CAP_MMAP_RX, CAP_PREAD)) < 0) err(1, "caph_rights_limit"); }