From nobody Sun Jan 29 08:19:30 2023 X-Original-To: dev-commits-src-main@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 4P4PNy6K67z3bplP; Sun, 29 Jan 2023 08:19:30 +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 4P4PNy5q6Bz3F7d; Sun, 29 Jan 2023 08:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674980370; 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=l3k9YoeSzG2++7HwoQQd+B1BpEGz1fAlgcbnubxQ8y4=; b=pdf3shmavEQjoAqhW2drSSmOkn8tD3oRXKBDrqRHcCCzgpCxBTkBQoN8X45OlG4aL3mZ6u BfOj60esx/Fson2IHnN4deZWUjN8nGWHHa2AoBdytmzp5FX4XN4Q620I2/DwaOiNdNJ9O8 JXwI1PrpANVwmy748ak5vML02oT2G+iQxjml8JoiN4f2UigELEfwJn5JT5dLolcQmu7CUy SlSrsYpYS90Xwr4JrjcBYRDikyuis0JvIfiuOC3iCW5GAx1OHa23HKtWmEBHnC/RPJWdEq 0JMcSOKNfk+T3TZhZ30yht0LolqynxdJeiTKGQzgchLTskkG4I24N2d6z/t5bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674980370; 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=l3k9YoeSzG2++7HwoQQd+B1BpEGz1fAlgcbnubxQ8y4=; b=w5UfpnuZ3CMdwHSHOspcUd1vNYepRUt2/9D4w9MlflDcHu3Rl5X6q5vNoRpgxvDQgfkvko an0Q4gQ9gsMtH3UQ+XRRSbiXrPMaRAcGnGuHYj1KQvCOdfYZeVDuGS9r3HCbdZla2KA9kH KmKg6B0G0A21amGfOu0ZEVqTjbQAPtO4NHMtRGSQVCyhsqhwEwQwmUj72sEjr3HmLKfLiy ZEsjIzHIfyKqoDg01Ow6cBuMiy22/KpsB8KVlZSSGsjYgbE8elIezyTC1PdHCfCP8NHVmO +2r/r1PjE2CDKSYfdGDISgMDyaNnBXyIkREqbEbV6g3Z7gOUZ8TOY2YjoJ22nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674980370; a=rsa-sha256; cv=none; b=qK5QOXpqa4Ra0PhYfu4lQv9h96yNyDL2+q6wSp5C7kZe2CTMWKXUfOnoltz28WcZpczj16 bgnqjYYAlWauiTxw0CEgvgJaEuOpQ/y1XWj03brfcnR8uK6VyHA0u9XjtE7hKmc6i64F3v iIqCwIMpkJ6Hg/r9bbtCMddHctH0oq0DYQ4wwlEy518VyUzhe+vxURidHpZASfMFT8ztJ8 MwxgDX59TDt9NfNxf3OP2jGdXK8ZfP8XNxTudf5I31gcLG9s4jUbyRviThXwkFO3N9f3/7 CGlrS0qz1uuOtW6nDZe3XNWzPbpCIgG9e0PYgCTK/ole1z+jbrcEYBXtcz0wvQ== 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 4P4PNy4syVzLmZ; Sun, 29 Jan 2023 08:19:30 +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 30T8JUHd080258; Sun, 29 Jan 2023 08:19:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30T8JUW4080257; Sun, 29 Jan 2023 08:19:30 GMT (envelope-from git) Date: Sun, 29 Jan 2023 08:19:30 GMT Message-Id: <202301290819.30T8JUW4080257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fedor Uporov Subject: git: 9ad2d4c4907d - main - Fix pjfstest issue tests/rename/19.t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ad2d4c4907da9c9edd4826219f6fa08544d31c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fsu: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad2d4c4907da9c9edd4826219f6fa08544d31c4 commit 9ad2d4c4907da9c9edd4826219f6fa08544d31c4 Author: Fedor Uporov AuthorDate: 2023-01-26 10:17:48 +0000 Commit: Fedor Uporov CommitDate: 2023-01-29 08:11:23 +0000 Fix pjfstest issue tests/rename/19.t The rename call with args like: "./dir0/dir1/.." "./dir2" will cause MPASS failure. The tmpfs_dir_lookup() does not accept names like '.' and '..' for lookup. Move the '.' and '..' entry check before tmpfs_dir_lookup() call. Reviewed by: kib MFC after: 2 week Differential revision: https://reviews.freebsd.org/D38051 --- sys/fs/tmpfs/tmpfs_vnops.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 1e3a4ac68f3f..da934338948b 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1029,6 +1029,15 @@ tmpfs_rename(struct vop_rename_args *v) } } + /* + * Avoid manipulating '.' and '..' entries. + */ + if ((fcnp->cn_flags & ISDOTDOT) != 0 || + (fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.')) { + error = EINVAL; + goto out_locked; + } + if (tvp != NULL) vn_seqc_write_begin(tvp); vn_seqc_write_begin(tdvp); @@ -1044,8 +1053,7 @@ tmpfs_rename(struct vop_rename_args *v) de = tmpfs_dir_lookup(fdnode, fnode, fcnp); /* - * Entry can disappear before we lock fdvp, - * also avoid manipulating '.' and '..' entries. + * Entry can disappear before we lock fdvp. */ if (de == NULL) { if ((fcnp->cn_flags & ISDOTDOT) != 0 ||