From nobody Mon Jun 13 19:29:27 2022 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 1C0DC8542C6; Mon, 13 Jun 2022 19:29:28 +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 4LMM880DGRz3pTL; Mon, 13 Jun 2022 19:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655148568; 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=Go7gTgV/GjNzKn4TVYeXLYjn8PnxHHlq2paiGbOcJzk=; b=XIh9k9lmi6BxnLCWFKlRUy62GQ1H+NaXQqlq58nBvqDL+XfS20Dyav91FNMPZqDUu4OiQh oBAT0KwV43fxl/uDMNzk3P+qcUD2sNGOeECzhnAPlJH01qQ6/iTkCm/zdRNrVP2qOyKHHo uutxbeGPAZWWFWoOSeGEw3deY3Xv3MUd/Uzm/VZ6Rn/pEqJqY+ICYBvkeM222w+2KTacO3 CNmsbIIer4mzHQ19Nu8WeEtsDoX5zfuy4UDzLNkxNWl4TPjGMRPylfGDDwrF0c4fEfq+z0 bk6FVp1w5vTZgCzJ3JN/1knoyJ/eSLl20yUsBl0sqQK+5MFtTcHg8IuH0K4EaA== 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 DCA4C1BA9F; Mon, 13 Jun 2022 19:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25DJTRAC010615; Mon, 13 Jun 2022 19:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25DJTRIx010614; Mon, 13 Jun 2022 19:29:27 GMT (envelope-from git) Date: Mon, 13 Jun 2022 19:29:27 GMT Message-Id: <202206131929.25DJTRIx010614@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: 45ecb858242e - stable/13 - fdescfs: allow chown/utime etc on fdescfs fd for underlying files opened with O_PATH 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: 45ecb858242ee5875e0c732aeaaf2b9f35b08fcb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655148568; 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=Go7gTgV/GjNzKn4TVYeXLYjn8PnxHHlq2paiGbOcJzk=; b=vemn6FKrZlkS3N6opzgbMpo69cTWedoz1QrV6s6qtsK1PaSlquyUZlumZ0QfUwAOE30m2Y tZW8M1JSbbfTcDTWmPGF4YofpjDy7SuHVh1kyxfA86AQs560Zb72/8GHUwUjt0oIsFVkQZ 4lotQKJWe/USqK+nQGiLA5vzVV4t8HF0vFRbmDR4YSfn1u99zFV0RyECP55WHItnGWCgfN D1GSoQTUuGQLvWq3tRML5LGuiWeDYKPWDUPy0SC3ykiVbnRA92R7nnWRLlv34aRE2+fTyk P/Wbwetx1nmZb9qYzSI1YSI3hpSJAKM0iazhYwioK2+WNMNx1DcVGHEkGoy/YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655148568; a=rsa-sha256; cv=none; b=j3PWkcH47OUQtse82joWqB8Bd9qB6Ki7acU/1nvhrxOQx5WT5mJip5DkAnZOO6UMVFTutl uxf2R1UM+0zcuAkz1rfVP7/qJIm7cxEWHniTj+XpHFZA8OhfXFaS7ugw41+tIzjXj5RrZ3 FJ3sbMR6QjhDANdDsqov/8g0o5uosiQF0qHCCZyZwAhfjR9akJWkpXPAsILiS/bETWyIcx SKB0xjqpiNIxEu4slXXI23YLF7h9nlo/aIq6n0L8YbBKgEX2poJrGaB7jE/xRBvMn3c+vT UVfwXTZD8YdLFGa7/ka5PvaLoMgqj2+W3Mj3jPDCaIGFTf9Jjg1T2+/OH0/mLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=45ecb858242ee5875e0c732aeaaf2b9f35b08fcb commit 45ecb858242ee5875e0c732aeaaf2b9f35b08fcb Author: Konstantin Belousov AuthorDate: 2022-06-05 18:49:09 +0000 Commit: Konstantin Belousov CommitDate: 2022-06-13 19:29:23 +0000 fdescfs: allow chown/utime etc on fdescfs fd for underlying files opened with O_PATH (cherry picked from commit 156745b42d9e6dfa3d9c6dc480db7836683850cf) --- sys/fs/fdescfs/fdesc_vnops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index c5a7b86f1de5..087f9b2551d1 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -504,9 +504,15 @@ fdesc_setattr(struct vop_setattr_args *ap) /* * Allow setattr where there is an underlying vnode. + * For O_PATH descriptors, disallow truncate. */ - error = getvnode(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + if (vap->va_size != VNOVAL) { + error = getvnode(td, fd, + cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + } else { + error = getvnode_path(td, fd, + cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + } if (error) { /* * getvnode() returns EINVAL if the file descriptor is not