From owner-freebsd-stable@freebsd.org Tue Apr 27 03:46:17 2021 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E09FA5FD0C4 for ; Tue, 27 Apr 2021 03:46:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FTnk10rQMz3Bx7 for ; Tue, 27 Apr 2021 03:46:16 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f49.google.com with SMTP id 92-20020a9d02e50000b029028fcc3d2c9eso31663466otl.0 for ; Mon, 26 Apr 2021 20:46:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AqDqDyTtDE0N6bnYGzXNhO7hZz6J1o1n/9SXfvd7YF0=; b=O6z8QhYR5/bBxKOr1VeedNii9U92zec1xqQGMKZztUcl6t8UYxuYL0erss8TTUmFOc iMrOQq6L64Ik0v4fLLwp9b0gR/uJtIh/yO0WqjpZHZdVUTFkhfpIjbTH74y2r9WVW2aY nQ9tqOSN6SZC7KweYhMDGjB3sLBaeJNoFzOw0mNPbQgsB0WxQ8c+39PH3b4O6MdKjOIQ FqQMSZAaIdLE5vsabowCCYK40gV95ioHQhFUI397nXZT8EaxenK65tOQVf2XLLs5B6Ah JCNZMTQDteoQeEU4WnkLWJSqxZLpSuK9uCHvtYr0tk2F6bGBQAvf9hTClLZ3AN3Fc8or MGZQ== X-Gm-Message-State: AOAM531CpE+2dok11aPUd5p0Q7ShUbDi+FYg+j5w+1RHX7x2jA6ksqWX 02SUAjR5Jp+a6u7ST1smWqbfnOgKudoCyXwPV/E= X-Google-Smtp-Source: ABdhPJx9d2ibG+bdyigMX0kZRB1y6Q/0l43FpN9GfPdyLegB/xJTspqTfdOnSsMJJeI8K+38u9ve+MFSFZCcnvTkCBI= X-Received: by 2002:a05:6830:2399:: with SMTP id l25mr17620421ots.18.1619495175970; Mon, 26 Apr 2021 20:46:15 -0700 (PDT) MIME-Version: 1.0 References: <56a4a35f-b4d7-661a-f59b-8cd399784e6e@delphij.net> <4CFAA2E3-F8B0-41F3-BA2D-4802FC138E8C@libassi.se> In-Reply-To: From: Alan Somers Date: Mon, 26 Apr 2021 21:46:04 -0600 Message-ID: Subject: Re: zfs native encryption best practices on RELENG13 To: mike tancsa Cc: Peter Libassi , FreeBSD-STABLE Mailing List X-Rspamd-Queue-Id: 4FTnk10rQMz3Bx7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.49 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-0.99 / 15.00]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.49:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_DN_ALL(0.00)[]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.210.49:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(1.00)[0.999]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.210.49:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.49:from]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-stable] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 03:46:17 -0000 On Mon, Apr 26, 2021 at 3:04 PM mike tancsa wrote: > On 4/23/2021 11:47 PM, Peter Libassi wrote: > > Yes, I=E2=80=99ve come to the same conclusion. This should be used on a > > data-zpool and not on the system-pool (zroot). Encryption is per > > dataset. Also if found that if the encrypted dataset is not mounted of > > some reason you will be writing to the parent unencrypted dataset.. At > > least it works for encrypted thumb_drive, i just posted this quick > > guide > https://forums.freebsd.org/threads/freebsd-13-openzfs-encrypted-thumb-dri= ve.80008/ > > < > https://forums.freebsd.org/threads/freebsd-13-openzfs-encrypted-thumb-dri= ve.80008/ > > > > > > > > > > Thanks, good points to consider! I wonder too if there are any > performance differences > > ---Mike > Yes there are. Firstly, if you're using raid, then geli must encrypt both data and parity. ZFS crypto, however, only encrypts data because it operates at a higher level. That's a pretty substantial performance win for ZFS during writes. It's a nonissue for reads from a healthy array, since ZFS doesn't need to read parity in that case. Secondly, ZFS crypto doesn't yet support hardware acceleration. That's a huge win for geli if you happen to have a hardware crypto engine (for this purpose AESNI does not count as hardware, and it works fine with either geli or ZFS). Thirdly, in my benchmarks I found about a 5% speed advantage for GELI during reads, though I don't know why. But of course none of this matters if you're using a small number of HDDs. It's only an issue if you have fast SSDs or a large number of HDDs. -Alan