From nobody Tue Nov 28 21:06:27 2023 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 4Sfw4344yXz52Ylj; Tue, 28 Nov 2023 21:06:27 +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 4Sfw4336N7z3DkN; Tue, 28 Nov 2023 21:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701205587; 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=tf+GUFRL0CsBdlet+pZyoP/e4V6A9uUrqQ6D2HOdt4k=; b=p9J0ovKMIme6s/rhJP05IQGiFpzaFDcVdk37YHgqu/XJ617TmZrwnU5MHfmZYsP5l/7aY5 EFkFtmWB9g4InBuM3SmbivLNzZ5TxtNYZwOnDEHjnyj7CfZp/Lw55rYSQkxNU3X2JuSoDn l3aB+sZzNdgD4dUW31Rdf6h7Ds8Vvw2NBBrLufyrpPpL603i26sYGlVGPVVphRJut8n/s3 Z0+fz6cu1h4LpVqCgxq9Ry6obbaKX/iB2bLyZJqc3XLRK/7dX6fScc1nTdWroERY73k18d 8ku6zd1pGmMJwjjoWttxZ3OqRt1xFT5yKc6r5rQzqIFL8Ekfb1N8lydlS8hmtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701205587; 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=tf+GUFRL0CsBdlet+pZyoP/e4V6A9uUrqQ6D2HOdt4k=; b=N1IWyQ9Wj78XsdmudCO0ueTWlj9+uqJ/x0yS5jeN7gxz+wIz2oyxLYyd2PV+J5ysHVqRJd 2BDnq3KO9IAvZG/EuyPEDFsUTi/Fg2+HrSV5qLLzzdErajdz3cfbayj0qDYN4fyNajf6MO mfqsYHikSilkTOYZM9mLbQ7/+7sppAAvUqswyDKN7l3RTNqIemFFsZJ1UGFJVYhwUZ/8Ng hfHZQ4a2Z3ykLB94jdNTOspJJfv4RzHBdWbJx2OIBFInx5UI6OtpxDLljYUbI2J0Weszjr 7BxOVTWrkjcHzgyFlRactMpg6iVQaQxMbg6TmJDAq/YejKsnIXEBZJLCNy8Acw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701205587; a=rsa-sha256; cv=none; b=xqUut+hluQmQAJWqJnD24k7lNm8g4QJPJm1Kegw+si9EmTmIX1ln0RD3vQhSGjzxXx5WLu mjtCWNQLLmRFYeYcaXJ0STvg8r+0ykJ/T523GGtlGJWKFlE0a88KTd0DWjDdkLxvQqZftq fBJiLZ35pAXHQm92Pju+pXiFT3hZJCK3HaIv2qvVgw8nC45FRlh0OkTzYBMyBGsPNSxLLY c2WK+SE+DPJS9F6JhWyxhknkqUApJMMu1HhfO4457WxAnGSUs/VSY+nFW6g7yLnA+5eMgO a7ZeAHIVIlXXOxlmA/nbRMsAv2c0wUOOJk9d1yyo1IM6iXT6oFqdkdayJkqCaQ== 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 4Sfw431bqWzdY8; Tue, 28 Nov 2023 21:06:27 +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 3ASL6RTe082169; Tue, 28 Nov 2023 21:06:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ASL6Rc7082166; Tue, 28 Nov 2023 21:06:27 GMT (envelope-from git) Date: Tue, 28 Nov 2023 21:06:27 GMT Message-Id: <202311282106.3ASL6Rc7082166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 1b910e43b021 - stable/14 - zfs: cherry-pick commit from master 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: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b910e43b0216b284bddc83dbdb1322f8d76062c Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=1b910e43b0216b284bddc83dbdb1322f8d76062c commit 1b910e43b0216b284bddc83dbdb1322f8d76062c Author: Alexander Motin AuthorDate: 2023-11-19 01:01:03 +0000 Commit: Martin Matuska CommitDate: 2023-11-28 21:00:02 +0000 zfs: cherry-pick commit from master #15543 27d8c23c5 ZIL: Do not encrypt block pointers in lr_clone_range_t Obtained from: OpenZFS (cherry picked from commit 27d8c23c582056a23509a7b80844a1b6435750b0) --- 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);