From owner-freebsd-current@freebsd.org Wed Aug 22 18:30:11 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D65D10918D3 for ; Wed, 22 Aug 2018 18:30:11 +0000 (UTC) (envelope-from sef@ixsystems.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F063B83556 for ; Wed, 22 Aug 2018 18:30:10 +0000 (UTC) (envelope-from sef@ixsystems.com) Received: by mail-pf1-x434.google.com with SMTP id b11-v6so1378080pfo.3 for ; Wed, 22 Aug 2018 11:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ixsystems-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5bQQP2lkwg92kML+IoMdcz/5c9zPBB0qC3JdQIS4MlQ=; b=ck553h83UCxcqDHzUVf/6nQhTcUCGMAmEQzf6rZCrCUl5nCMHn/QqXH5UkwieRV/hF nGVNmimFeT7cBTLObq2YC18a221j6SpXknm017MApI+ll9SPYFoOHv1UIIWNYdq7UGUA mnop5VkIaopR3EYa8a0pxQlWyFwH9GiRCrqCn5Epv/cspBSz5rxm4e+LZbMxgROVxEHV Ac97FwEj62JweQuDHI2g7dHhbbcIJDyPKY1bEz93itq1OaYN+RDhD7xWet1euRJN60jS 5F/Gmrgdyb4GcT8D3QN94HXCnScSt4ica1/FPIMEgvC9e0WV7XDYsav/gdPcZeXctX6/ X5rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=5bQQP2lkwg92kML+IoMdcz/5c9zPBB0qC3JdQIS4MlQ=; b=GKk3S0ranIH4GAqGoK+wV7YeFn+Es5wtFtliFnlNVSip4hqVSFlsT7aUhftIVMoAm+ jiN1YqA142UowijiKh2c+nXUQOugMFU4oCCops8lgNPH45LMnf1qiWwUtJNDuJQBY5zT 3oc3E0lyNKTWXNCfmZSUHlBEJKM1OUTNcGoasWehXrdzqYFtLqZ6FFXlHr+OhbtnPws8 CIJxfjovZzyJfgqBFa+8MwaT2e/m54wtKXcUJeLHa5vohC/7dZyOWAttZzUMxoQbAGoR de+PvNMYID48cfGLmm1mOMJdh+ofYHYQ5r1qQnjxkueHTXHqflEy7VzI7KdKaIYis0D4 pgkA== X-Gm-Message-State: APzg51Bkseh9BXtk0cV3BLITepHNIOTafM+xMrNbOWrSVVbs7G92epON uLe1CSI8i5H691uXwotDwU+BdQ== X-Google-Smtp-Source: ANB0VdaeQMKvfYHml2udXcqguR3LDNGU+XFfxHD7J2XqC3B3/jydTZvo94Mvr4IpE1SZkBF2wIG1Og== X-Received: by 2002:a62:384a:: with SMTP id f71-v6mr7929340pfa.48.1534962610065; Wed, 22 Aug 2018 11:30:10 -0700 (PDT) Received: from [10.250.1.167] ([12.229.62.29]) by smtp.gmail.com with ESMTPSA id k1-v6sm2950804pfi.62.2018.08.22.11.30.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 11:30:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Native Encryption for ZFS on FreeBSD CFT From: Sean Fagan In-Reply-To: Date: Wed, 22 Aug 2018 11:30:07 -0700 Cc: Matthew Macy , FreeBSD CURRENT , freebsd-fs Content-Transfer-Encoding: quoted-printable Message-Id: <9FDF249A-E320-4652-834E-7EEC5C4FB7CA@ixsystems.com> References: To: Alan Somers X-Mailer: Apple Mail (2.3273) X-Mailman-Approved-At: Wed, 22 Aug 2018 19:27:04 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2018 18:30:11 -0000 On Aug 21, 2018, at 8:16 PM, Alan Somers wrote: >=20 > > The last time I looked (which was a long time ago), Oracle's ZFS = encryption looked extremely vulnerable to watermarking attacks. Did = anybody ever fix that? This is the comment about dedup in zio_crypt.c: * CONSIDERATIONS FOR DEDUP: * In order for dedup to work, blocks that we want to dedup with one = another * need to use the same IV and encryption key, so that they will have = the same * ciphertext. Normally, one should never reuse an IV with the same = encryption * key or else AES-GCM and AES-CCM can both actually leak the plaintext = of both * blocks. In this case, however, since we are using the same plaintext = as * well all that we end up with is a duplicate of the original = ciphertext we * already had. As a result, an attacker with read access to the raw = disk will * be able to tell which blocks are the same but this information is = given away * by dedup anyway. In order to get the same IVs and encryption keys for * equivalent blocks of data we use an HMAC of the plaintext. We use an = HMAC * here so that a reproducible checksum of the plaintext is never = available to * the attacker. The HMAC key is kept alongside the master key, = encrypted on * disk. The first 64 bits of the HMAC are used in place of the random = salt, and * the next 96 bits are used as the IV. As a result of this mechanism, = dedup * will only work within a clone family since encrypted dedup requires = use of * the same master and HMAC keys. (So, same issue. I don=E2=80=99t think encryption and deduplication = should live together, so I would not have made that choice.) Sean.