Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp612607pxx; Mon, 26 Oct 2020 16:54:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNzKonupxwFl5TX2NnDxJ0BIYyMk7NSuS1D3Ef3toxqJ3ejPRl8Y4yEqfhpJfQMwoOp5oP X-Received: by 2002:a17:906:6545:: with SMTP id u5mr18073581ejn.346.1603756466216; Mon, 26 Oct 2020 16:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603756466; cv=none; d=google.com; s=arc-20160816; b=oGPWwRvbIF+dYC81RJZkLYI1dtMKoSksGarOHS+qpvXRjdiMO3L07o91qGqqlNvUzJ elLIdyJsQd58pqcnvYuMzS5fabcoIcOyj4+4LriVPQUqdnKIi0g9O5VkS/aAv06RHUhK SkMmma9hxS3rDV0fNauDyBnWdllVogV1bozT+k7hJR5P8fJvq3+sovZyyFr7z9lj778M DEiORYAgz6pQzCI3QWi3xtIEW8m3kSDeGZulZQlqAyQdRuAmz2p5OUBxbRgoxKugIlnV uAMTRTklLBUEB0nJ0C8baQBL6fJbUWJuXlfkNh83+XRQYoTz8yUlhKzJ8l/I7jwDvloR 3itg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Vv8QX0mXek+iVwa0PLmBZRi4t6g6SQqpZZ7vrfZ8LxM=; b=PbgovtDfiTe0Q8h97Tt9jKtSiZ5Pt1BHZJf8iX6NQDcY2vgBjAFuSnuhNfCwalwGON U2TAz0ekynmfvrDtIS6WnuIx9XbWSF/dRnXOw7dbLms3aXVjVykIqZmDe5ZOMm16Ec8c 4qCwxSbyVyOCype3p6t40XUGj0L1Lz8HLAIlAIIRbnoVdv1ynsmTJYvk6sYXL9uk+WMQ SMj1m8sVvR7e6VwtiEr8GHLoUyH7qgxyNC7XBaGCXg0MzTz1HtuF2LJrMdJ/TEAR+qiS uluX4snbouG4owEvmprsh0w/YaMYY3d8yt65HlfRisMQ40CuJq094h60O44ZqRYO0KfD dK/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t8GeCQ8Y; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si8032998edq.238.2020.10.26.16.54.02; Mon, 26 Oct 2020 16:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t8GeCQ8Y; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404216AbgJZTNS (ORCPT + 99 others); Mon, 26 Oct 2020 15:13:18 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45200 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1735309AbgJZTET (ORCPT ); Mon, 26 Oct 2020 15:04:19 -0400 Received: by mail-wr1-f68.google.com with SMTP id e17so13919665wru.12; Mon, 26 Oct 2020 12:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Vv8QX0mXek+iVwa0PLmBZRi4t6g6SQqpZZ7vrfZ8LxM=; b=t8GeCQ8YvzAivbqfQO+3MRLLzvwgvvHV4+49F67htNXPgFVWZwyejS/cqBRttKYG7Q 3MThZmh0WRGcOEAXHnSG1TGeI0a6GKa7ciFimqyMPMjNSwTVVcaLoElxdu0E2PuXRiqW g2RbceWU+CGpJHRvM/A579Rk9LSo5sIC1YkdjJ6VeL2RJRmP+PHzNVNgb1t3cDB350V7 erzHBbq6hsqDaCHk+WbZJPjuKR5AABK+2dbBDF3hP76YxNRUDkqqeGmrEspaOXbv7QZA D3DLGpOEp6bN08ZuOXn0vFzidNiP7DsFZKRLGIfXg5+trni10fQKtapZ5y7i/VoQXGkR xPRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Vv8QX0mXek+iVwa0PLmBZRi4t6g6SQqpZZ7vrfZ8LxM=; b=Be4oKO5VNFjmxUbjUwQpqIu2JaQ55NHL1IrBHTPOebtsbQTXQ+JaAp1oCOE93Awt5d c2wQKR+PNYYkciKDJ8GZsSicWG9B0ndvWFwe6ZJPCJfuBHsUjKQO8NA69GTQ+8CITLRx uZOLHLUGOdb8eRPNLBJSrCDAj8TyKPvEXQw7eudpQj8UCiERLUx4vVZbL6bP3HhcYkBe DHUKhR5MWHTmTHkW6noDpwGa5uAMYa66gnnIjGQHMI4s6U7YQHzfxZCXmrwOparBu3Ru XdRhlejM3tkTlzHlKyZxKOpU3wbCxlkm56LHZENdMjK+8ie7og1xl3YQMLuh/iCsunvd K/sQ== X-Gm-Message-State: AOAM531UtLcyr+y+Esp71FFhAGI14GkYiXBWrbWv5+WtUW2VtACaMtLY /ChB99sNO3rnTrucqtX78xcvjlHyUEkP1g== X-Received: by 2002:a5d:4010:: with SMTP id n16mr18635180wrp.97.1603739055074; Mon, 26 Oct 2020 12:04:15 -0700 (PDT) Received: from [192.168.2.28] (39.35.broadband4.iol.cz. [85.71.35.39]) by smtp.gmail.com with ESMTPSA id t62sm22625877wmf.22.2020.10.26.12.04.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Oct 2020 12:04:14 -0700 (PDT) Subject: Re: [PATCH 3/4] dm crypt: switch to EBOIV crypto API template To: Eric Biggers , Milan Broz Cc: Gilad Ben-Yossef , Herbert Xu , "David S. Miller" , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Song Liu , Ofir Drang , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org References: <20201026130450.6947-1-gilad@benyossef.com> <20201026130450.6947-4-gilad@benyossef.com> <20201026175231.GG858@sol.localdomain> <20201026183936.GJ858@sol.localdomain> From: Milan Broz Message-ID: Date: Mon, 26 Oct 2020 20:04:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201026183936.GJ858@sol.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 26/10/2020 19:39, Eric Biggers wrote: > On Mon, Oct 26, 2020 at 07:29:57PM +0100, Milan Broz wrote: >> On 26/10/2020 18:52, Eric Biggers wrote: >>> On Mon, Oct 26, 2020 at 03:04:46PM +0200, Gilad Ben-Yossef wrote: >>>> Replace the explicit EBOIV handling in the dm-crypt driver with calls >>>> into the crypto API, which now possesses the capability to perform >>>> this processing within the crypto subsystem. >>>> >>>> Signed-off-by: Gilad Ben-Yossef >>>> >>>> --- >>>> drivers/md/Kconfig | 1 + >>>> drivers/md/dm-crypt.c | 61 ++++++++++++++----------------------------- >>>> 2 files changed, 20 insertions(+), 42 deletions(-) >>>> >>>> diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig >>>> index 30ba3573626c..ca6e56a72281 100644 >>>> --- a/drivers/md/Kconfig >>>> +++ b/drivers/md/Kconfig >>>> @@ -273,6 +273,7 @@ config DM_CRYPT >>>> select CRYPTO >>>> select CRYPTO_CBC >>>> select CRYPTO_ESSIV >>>> + select CRYPTO_EBOIV >>>> help >>>> This device-mapper target allows you to create a device that >>>> transparently encrypts the data on it. You'll need to activate >>> >>> Can CRYPTO_EBOIV please not be selected by default? If someone really wants >>> Bitlocker compatibility support, they can select this option themselves. >> >> Please no! Until this move of IV to crypto API, we can rely on >> support in dm-crypt (if it is not supported, it is just a very old kernel). >> (Actually, this was the first thing I checked in this patchset - if it is >> unconditionally enabled for compatibility once dmcrypt is selected.) >> >> People already use removable devices with BitLocker. >> It was the whole point that it works out-of-the-box without enabling anything. >> >> If you insist on this to be optional, please better keep this IV inside dmcrypt. >> (EBOIV has no other use than for disk encryption anyway.) >> >> Or maybe another option would be to introduce option under dm-crypt Kconfig that >> defaults to enabled (like support for foreign/legacy disk encryption schemes) and that >> selects these IVs/modes. >> But requiring some random switch in crypto API will only confuse users. > > CONFIG_DM_CRYPT can either select every weird combination of algorithms anyone > can ever be using, or it can select some defaults and require any other needed > algorithms to be explicitly selected. > > In reality, dm-crypt has never even selected any particular block ciphers, even > AES. Nor has it ever selected XTS. So it's actually always made users (or > kernel distributors) explicitly select algorithms. Why the Bitlocker support > suddenly different? > > I'd think a lot of dm-crypt users don't want to bloat their kernels with random > legacy algorithms. Yes, but IV is in reality not a cryptographic algorithm, it is kind-of a configuration "option" of sector encryption mode here. We had all of disk-IV inside dmcrypt before - but once it is partially moved into crypto API (ESSIV, EBOIV for now), it becomes much more complicated for user to select what he needs. I think we have no way to check that IV is available from userspace - it will report the same error as if block cipher is not available, not helping user much with the error. But then I also think we should add abstract dm-crypt options here (Legacy TrueCrypt modes, Bitlocker modes) that will select these crypto API configuration switches. Otherwise it will be only a complicated matrix of crypto API options... Milan