From nobody Fri Dec 1 00:38:37 2023 X-Original-To: dev-commits-src-branches@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 4ShDgx72yNz5329r; Fri, 1 Dec 2023 00:38:37 +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 4ShDgx6FDmz4LbM; Fri, 1 Dec 2023 00:38:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701391117; 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=Fs9BOcArZO23u9texM4ksfADVvWWL0KsfOEjBAj6Av8=; b=aA57uq8zsOApO0eN+FNlOU6dY3xGrL6NcGOWl1vdLwhC2e91sgIdrG9EGK5iJ4z3j6a/A3 S4gHdLO6oMW+PB1mXcrgpPniIHOSIQwHScPGiwqRE3qL0jMRlZRPz0Ej7EqW4AtGKVZO9X tjjGmtu3XPJLjTySMmdGXfcR1VCN6VtsuwRrFncBu9NY7SUvfX3Gc590QgmJNUYrhsBHrH cruSJcRWf0F762FBwJDBqhdL/btDaDd5YrjZxwOI4hcAeexFXpk6EIXvfenoRk793AoJ53 nhYqNwLjGRLEwMTtRcqWEXjXTZdQcpaEtUmlc2oS/8K3/h1Th6GPyKItNK+OBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701391117; 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=Fs9BOcArZO23u9texM4ksfADVvWWL0KsfOEjBAj6Av8=; b=kPQx1KjI9L2+eC184MONRqKaNIxvJls3UzWku28QwKYv/gBpYagRXgA8CN1dkylLdEVOj/ B+dxR9ndLSIkhwTghyF0D68tZYRVv5NoYQ6PJHcTSUXsGcm6Wmqefhk6Pm0Ce9xJ9jSBCb dXr2vtshvH9oll/OS/+u7N4+KU8GLRYkTg28qsjnRP2VEVYQzzKJeC4ekkPcYq/SSc7K+A b4sKLCnM+MLF75fKt37UvxWNg/8OTRTjo9k02/GO3HK1l/ZyblNgg4CR+V05pD8QZs01yX papNLmrBtHzRjiCV2yzMFq2HEwse9n8dwKiZcb3hBhVlTatGII2TY3zjfxf8tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701391117; a=rsa-sha256; cv=none; b=Wfz0klbCi5IoWVjL+W6HW0HNR5vRrGcQGpnnC+eLN00KyRoYXFmdTE2OoAu4y7KVBgAe38 mlgp0zLKiMOs1PTAUU3f118GhK5DJ7kAr/UcxeYT8NVpT29PAFgQ9cClxVdCVpWvRI5T0I 7Qnq5vYpmWC50Pgv0ufL8Co1X+V6EZm9NkMcAbjacRphfPmU8SrR6ywSW2m8dNE9Jj13B4 JmTf1VcN5frQZ/HOgugQxVgIeSojj3ENdB5+2QFWnf+98qQJw3fcuV83qw88d3Ui71sjLR OLHSqpGfMfsAx75ah5XWqoHpamcTw9NcSwsNmEvhAaLQmF+tmjhvENMguwT1tw== 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 4ShDgx5KLcz1BhY; Fri, 1 Dec 2023 00:38:37 +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 3B10cb2q056707; Fri, 1 Dec 2023 00:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B10cbGm056704; Fri, 1 Dec 2023 00:38:37 GMT (envelope-from git) Date: Fri, 1 Dec 2023 00:38:37 GMT Message-Id: <202312010038.3B10cbGm056704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 36f4f90efb02 - releng/14.0 - zfs: cherry-pick commit from master List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 36f4f90efb027847d6e4b7a940afbee2ad7b3b7e Auto-Submitted: auto-generated The branch releng/14.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=36f4f90efb027847d6e4b7a940afbee2ad7b3b7e commit 36f4f90efb027847d6e4b7a940afbee2ad7b3b7e Author: Alexander Motin AuthorDate: 2023-11-19 01:01:03 +0000 Commit: Gordon Tetlow CommitDate: 2023-11-30 21:32:41 +0000 zfs: cherry-pick commit from master #15543 27d8c23c5 ZIL: Do not encrypt block pointers in lr_clone_range_t Obtained from: OpenZFS Approved by: so Security: FreeBSD-EN-23:16.openzfs (cherry picked from commit 27d8c23c582056a23509a7b80844a1b6435750b0) (cherry picked from commit 1b910e43b0216b284bddc83dbdb1322f8d76062c) --- sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c | 13 +++++++++++++ sys/contrib/openzfs/module/os/linux/zfs/zio_crypt.c | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c index fdbe13dbb5e9..024a931d7816 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zio_crypt.c @@ -1364,6 +1364,19 @@ zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf, vec++; total_len += crypt_len; } + } else if (txtype == TX_CLONE_RANGE) { + const size_t o = offsetof(lr_clone_range_t, lr_nbps); + crypt_len = o - sizeof (lr_t); + dst_iovecs[vec].iov_base = (char *)dlrp + sizeof (lr_t); + dst_iovecs[vec].iov_len = crypt_len; + + /* copy the bps now since they will not be encrypted */ + memcpy(dlrp + o, slrp + o, lr_len - o); + memcpy(aadp, slrp + o, lr_len - o); + aadp += lr_len - o; + aad_len += lr_len - o; + vec++; + total_len += crypt_len; } else { crypt_len = lr_len - sizeof (lr_t); dst_iovecs[vec].iov_base = (char *)dlrp + diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zio_crypt.c b/sys/contrib/openzfs/module/os/linux/zfs/zio_crypt.c index 55554d09ee43..775ab8efbcdf 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/zio_crypt.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/zio_crypt.c @@ -1543,6 +1543,21 @@ zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf, nr_iovecs++; total_len += crypt_len; } + } else if (txtype == TX_CLONE_RANGE) { + const size_t o = offsetof(lr_clone_range_t, lr_nbps); + crypt_len = o - sizeof (lr_t); + src_iovecs[nr_iovecs].iov_base = slrp + sizeof (lr_t); + src_iovecs[nr_iovecs].iov_len = crypt_len; + dst_iovecs[nr_iovecs].iov_base = dlrp + sizeof (lr_t); + dst_iovecs[nr_iovecs].iov_len = crypt_len; + + /* copy the bps now since they will not be encrypted */ + memcpy(dlrp + o, slrp + o, lr_len - o); + memcpy(aadp, slrp + o, lr_len - o); + aadp += lr_len - o; + aad_len += lr_len - o; + nr_iovecs++; + total_len += crypt_len; } else { crypt_len = lr_len - sizeof (lr_t); src_iovecs[nr_iovecs].iov_base = slrp + sizeof (lr_t);