From nobody Wed Feb 26 22:24:32 2025 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 4Z38Cj2D7vz5p3Yd; Wed, 26 Feb 2025 22:24:33 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z38Cj0y7Wz3mDJ; Wed, 26 Feb 2025 22:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740608673; 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=1h+v+ffPWl4U7F/q7x4MnymaM+DSgfZHbbmtPGEXR3c=; b=J2qcpIcMbBYqcq0tCeJ9rlf6AG/VR0bHI5RfWzAJSkJXYc+SHBaSNqvfkwb825WQgB1dz5 vUzBVXAqzQoZwp0V0ZJzxyB5rFzrykDlvfW8I78TIdoEL78pSjoIb6Pn2vYOsTVa8tqto3 vrwUx/mtrxCNvExtkoRGJDqFe/UowUwyBH/IhlZNV2Zfw/nvwd61OJKw0JWd0/c0e1dUKS MW/maf7kCdLzzSdOlIhDKRakUvkFEVo8IsHjKWLZAw8mG9MOk5eIgoCNMJ/OHq8VQsI7/v ygtnxpTV2NqrtqWa6laGMlLAXmrcUGpsOGcbLYRN4o4HVWjy2b9mS+ZvHtuXbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740608673; a=rsa-sha256; cv=none; b=j+b3EZtXwluaTuhLYyo+fyTEjjSEnmIJoiCNUAyoq41dUwZfMptJdrHIW6wE/ngRP64VAA 3LvS1RxIQ22/E3+nFD9IUarAFSC5Arpj1xvhdPl0kXdBBNjG6/ugKOfWez/SxUnvmFR2wm BUVkp3Ia66UUiPKVpaDHoRElWK5Cdcy13dazGW+CgvMkyeXj6TaG0ZMOkMZnof/RHFdNfR lcbF1XjbJ1nAM4dPJXW7Hyesag98IVHZXyf6zD4S0/hkN6WFThBE3fJ6UPsXYVKV7f1Myb 0WnaRiJOzZu5z2NcoAMEGUkwZq2jUn5ZFTb8I7hWxEl4/PpdgzGAB/4y5vtRQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740608673; 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=1h+v+ffPWl4U7F/q7x4MnymaM+DSgfZHbbmtPGEXR3c=; b=D1qDGOkP7So06LIEZysTTlex+JgjUG8Icd33Kz78iQdYfe0i6WmQKwnBkg/PZoAW1WUIyt ri6xaTyyCTDmPQj06k8+7fO1DAz6t5QNmqir8KGZEbZ7vTYIeabkV7sfKRXIbm8Lcshzhj UNs9Tw99FD14N40l62dXpJq/riGPzhWhl9+gqiphN6SD1a51w03oxpWw5wJO8NcIw+/NWi lUIVLuQclfMcZTGABfLnUhmGE220xr554a9pn46sZp24R1ZhWhGPpoaQ0NYKB705/ppZs9 YPK45/1Kn1JboazE9qWkYmzydoXa7Rnd8bj/hSxoszSnhtDWXvEw4umaVdpTHw== 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 4Z38Cj0PQDz17N; Wed, 26 Feb 2025 22:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51QMOWKl036226; Wed, 26 Feb 2025 22:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51QMOWWM036223; Wed, 26 Feb 2025 22:24:32 GMT (envelope-from git) Date: Wed, 26 Feb 2025 22:24:32 GMT Message-Id: <202502262224.51QMOWWM036223@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 181549c37f19 - main - libbe: avoid copying encryption-related props 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 181549c37f1913f5ca292d8515a6e5e0068a9fe7 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=181549c37f1913f5ca292d8515a6e5e0068a9fe7 commit 181549c37f1913f5ca292d8515a6e5e0068a9fe7 Author: Kyle Evans AuthorDate: 2025-02-26 22:23:24 +0000 Commit: Kyle Evans CommitDate: 2025-02-26 22:24:24 +0000 libbe: avoid copying encryption-related props libzfs insists that these be cloned from the origin, so avoid making a deep copy of them ourselves to unbreak creating a new BE from a BE with encrypted components -- in today's environment, without a loader that does encryption, this means a deep BE setup where something underneath the BE (e.g., home directories) are encrypted. Reported and tested by: arrowd Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D48464 --- lib/libbe/be.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index 62563a33d975..e0ced1c5bcfc 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -680,8 +680,20 @@ be_deep_clone_prop(int prop, void *cb) dccb = cb; /* Skip some properties we don't want to touch */ - if (prop == ZFS_PROP_CANMOUNT) + switch (prop) { + /* + * libzfs insists on these being naturally inherited in the + * cloning process. + */ + case ZFS_PROP_KEYFORMAT: + case ZFS_PROP_KEYLOCATION: + case ZFS_PROP_ENCRYPTION: + case ZFS_PROP_PBKDF2_ITERS: + + /* FALLTHROUGH */ + case ZFS_PROP_CANMOUNT: /* Forced by libbe */ return (ZPROP_CONT); + } /* Don't copy readonly properties */ if (zfs_prop_readonly(prop))