Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp414365ybl; Fri, 23 Aug 2019 02:49:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIdGY97a/P+MCbnkqepy/SWocGW1u6A0975FGuLPV5IiIKEX1o9XlE0qGW2rAZ0UsKndwx X-Received: by 2002:a17:902:7797:: with SMTP id o23mr3779372pll.102.1566553796817; Fri, 23 Aug 2019 02:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566553796; cv=none; d=google.com; s=arc-20160816; b=YFdgxKqMHSapypr+zNh3ZVlD2n3+346QqtgZrA8DkPGG/1WLtELhmqspTw7Z4TnYZH PfLKxwPzsK6Rvk6501kQh52zbefXmlTzwNFzASTvdvw1nB9+u2KAWSPaQyUnAisDCkZB 2+tgNNAbrGW04tywUQfllHiB0UpcXyUi6S906gyFe332rYz0eUsgUXOnoFt+aZHmAD0E xg7wK1aG4A2FWkUprsmNHnKK77iwX38YtzGIWWhl5dC9pjYBP+GzjG9e6g7ahf0wBv0Z DHyBnxi61DmthaPxdsn8E3qq8YPB5mqzXI6GZYulD8TgBQCRyAwBlaZ8hn8x1fxUAlFG qAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2Ob+A4xxX2bRSxLGz92/UzTEvC1yWM8JcjhiXKDPfB8=; b=yV1gmy046EvICS3kZxLIBuvVzqq3Dii2+H0iSNfGA+Ab+LgZlqdG4GIvZ5gyqytmFN +xcna0IyJWAwsgffoFl4zx1y0kOhMhdDD6tCkuGjP0WDuPbe8CeFWNP+igiBuWlZ3S5W Vn7UudZ+aUgZKCMt32KOzzUIdQ5Ys6ykAarL0FpU/xlyX9BAFLePEYs3pl7r3q2guvLh Sk7BKm3sOZFl+2XUtKJB3Ey5JcDOSTVgXdysTOFjYlAc+Jarlv26p3HL3aWwXmkaSl4e OeqKmuSIFn0NTBSKrOXyM2j5L89181lR6cwtSAwUIyILM9Ku3IeH1fzxkSlUcBvDTB/8 K0WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=flcLM5FZ; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cu10si1927072pjb.16.2019.08.23.02.49.34; Fri, 23 Aug 2019 02:49:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=flcLM5FZ; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390710AbfHWCf3 (ORCPT + 99 others); Thu, 22 Aug 2019 22:35:29 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:46628 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390934AbfHWCf2 (ORCPT ); Thu, 22 Aug 2019 22:35:28 -0400 Received: by mail-io1-f65.google.com with SMTP id x4so16504564iog.13 for ; Thu, 22 Aug 2019 19:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2Ob+A4xxX2bRSxLGz92/UzTEvC1yWM8JcjhiXKDPfB8=; b=flcLM5FZxA1UdTl+5MfostzBYwQfyv1yb87DaSzrnDrUwd/ZNj4K4T/rHszC/sFQMH ADUFV/N/N6vulg+PsFB9LiJOba7WYzMsXqe7TkwmxiwQw++HUI5Q9lwxgsadqj5kp36o 7ir9Ftxz3Frpzbh7dbD9IWl/fAPy+uyEwFD9Qu0xwImVT/66UuNo3m+3vDu9rqcZdHGP dJuOAFAhp3e0iD0AWnqz3VAQtqcjnUDCLFkZZiPVDrJq83kU9d3bg+KlteAnZK+XFKE6 M2BK3WAwQy2tydaBr0xJ2dcLV8QJVxM3CxkgnlBsNXoibdFYaWIIutqUzeXdd2gExoTy FEcw== 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=2Ob+A4xxX2bRSxLGz92/UzTEvC1yWM8JcjhiXKDPfB8=; b=NMJNCU7gEUsD0tHBQdfsXWkASSqUggxSJO3wYbgVPz/1JZjJFz114JgodydP6ewYWL LnuPsR5ekc0Fme4Qkpd4aHzX8o484BBEvroKav1B8anuQ3b1HFRRi8D71H3xBHjljhBt P1ozzRs5iaXf2fu377i6wG+QJD6v9c+Wyd79CqPb63eQgsq9grYmTTR7Y+0SgFv5xZoX gbS62hox6+SmkNWUbDWbldY0xul2ZwlEumfvPg+QRjXH/S0eXH7YcLPm56T/hBZDQQJf FxZ1Rm1sTP3pV/qRRuKc4IxiqxRB+fxFttyJJZF0ehqKyIUxh25E7jaNUjp68m10s5na gGsw== X-Gm-Message-State: APjAAAX5u64gzAqDnlVFGuDbhuSHEc9kAcQAnqLK6hEC/Xw8kf0Cr7sS yrVCwVPPOWFtlQbOB0Qh20JPtb4B0H0GQLId6vXODQ== X-Received: by 2002:a6b:c581:: with SMTP id v123mr3719443iof.158.1566527727590; Thu, 22 Aug 2019 19:35:27 -0700 (PDT) MIME-Version: 1.0 References: <004101d557eb$98b00060$ca100120$@samsung.com> <6ea5e5db-4dd4-719f-3b3e-b89099636ea6@kernel.dk> In-Reply-To: <6ea5e5db-4dd4-719f-3b3e-b89099636ea6@kernel.dk> From: Satya Tangirala Date: Thu, 22 Aug 2019 19:35:16 -0700 Message-ID: Subject: Re: [PATCH 5/9] block: support diskcipher To: Jens Axboe , boojin.kim@samsung.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Herbert Xu , "David S. Miller" , Eric Biggers , "Theodore Y. Ts'o" , Chao Yu , Jaegeuk Kim , Andreas Dilger , dm-devel@redhat.com, Mike Snitzer , Alasdair Kergon , Krzysztof Kozlowski , Kukjin Kim , Jaehoon Chung , Ulf Hansson , linux-crypto@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Aug 21, 2019 at 5:10 AM Jens Axboe wrote: > > On 8/21/19 12:42 AM, boojin.kim wrote: > > This patch supports crypto information to be maintained via BIO > > and passed to the storage driver. > > > > To do this, 'bi_aux_private', 'REQ_CYPTE' and 'bi_dun' are added > > to the block layer. > > > > 'bi_aux_private' is added for loading additional private information into > > BIO. > > 'REQ_CRYPT' is added to distinguish that bi_aux_private is being used > > for diskcipher. > > F2FS among encryption users uses DUN(device unit number) as > > the IV(initial vector) for cryptographic operations. > > DUN is stored in 'bi_dun' of bi_iter as a specific value for each BIO. > > > > Before attempting to merge the two BIOs, the operation is also added to > > verify that the crypto information contained in two BIOs is consistent. > > This isn't going to happen. With this, and the inline encryption > proposed by Google, we'll bloat the bio even more. At least the Google > approach didn't include bio iter changes as well. > > Please work it out between yourselves so we can have a single, clean > abstraction that works for both. > > -- > Jens Axboe > Hi Boojin, We're very keen to make sure that our approach to inline encryption can work with diverse hardware, including Samsung's FMP hardware; if you can see any issues with using our approach with your hardware please let us know. We understand that a possible concern for getting FMP working with our patch series for Inline Encryption Support at https://lore.kernel.org/linux-block/20190821075714.65140-1-satyat@google.com/ is that unlike some inline encryption hardware (and also unlike the JEDEC UFS v2.1 spec), FMP doesn't have the concept of a limited number of keyslots - to address that difference we have a "passthrough keyslot manager", which we put up on top of our patch series for inline encryption support at https://android-review.googlesource.com/c/kernel/common/+/980137/2 Setting up a passthrough keyslot manager in the request queue of a device allows the device to receive a bio's encryption context as-is with the bio, which is what FMP would prefer. Are there any issues with using the passthrough keyslot manager for FMP? Thanks! Satya