From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87FB5C3A5A1 for ; Wed, 21 Aug 2019 12:09:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2216B22D6D for ; Wed, 21 Aug 2019 12:09:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="1mTbly5h" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbfHUMJz (ORCPT ); Wed, 21 Aug 2019 08:09:55 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37030 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727918AbfHUMJz (ORCPT ); Wed, 21 Aug 2019 08:09:55 -0400 Received: by mail-pl1-f194.google.com with SMTP id bj8so1242407plb.4 for ; Wed, 21 Aug 2019 05:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UT6yE/roxwyyBSRfLOwrFlilraLjBXjoNWJQAsldDVo=; b=1mTbly5hNN6suDS+BwBXn5tZNQRoJv3U+6eGIZWkxOpX8gp4MfK0srbyshCamPl8cE oynbwAZaUVd3iYuDw/fFqllqnUyyMdhGmWDFTWD0+uRBHO1RABomqwNTPTloesNaBCP/ OF0wNlT1X2HUApuEYt9hqsB3ukfCOmKOxQ9VlFGyTVla9DArrhzV46cf0e1hqSL0Em1S kMKT+OUOB39Lc9u+MllIcA6W2VixaWAmIOOCqIPym//+KF+bJLzrXd5uXWfD6RF+tn8O fEItbmLNgpz+3xyfCw5xuoCb8BCqv/jPsevOVEPakCBbt5mOdjvlnK19JQHJXISJTFII +AuQ== 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=UT6yE/roxwyyBSRfLOwrFlilraLjBXjoNWJQAsldDVo=; b=Whp70bH2EwPMY14ZSiPt4a35Aw3EQXEIy+095Elr6+RYaXlG70SNaml+z33uYZKSe8 hHKVL6nhkT0+SuuFygwOTw3ccMYclKqzoNzEDS0o9zPk5+Ttdg0W4hMwrRWk/D3UqqzY ulP+WuC+cPJvJwvPBtHmkq01gpnJi06N8Kz4aG6NqDW74CHf7FyaI6dfQPx3YjdHpyZ0 /48FGkJ2uVUtXmbwDlZfBUCsTCdrUAMtEBw6bWGibIsmgjOTkaFWnfV1YD0Cyo9Gnzd+ 7uNZTr9WVbxuUHAaV9qPeBZq1NDyddlicQbh2mtMy0x0wkIwHuqJ1+pul1E6n0BPVROx XIUw== X-Gm-Message-State: APjAAAUMCYpuhbSMrocaJ3ZuPOnVDS0CQpcjyAuFxmRqPGnVuO1qtq0n 4QUMRWkrfFRQRJfss6rwlsB/zraFDqhKng== X-Google-Smtp-Source: APXvYqxsoe31YiWALXWqRLHXasZTZR3nM8GXNUHwTUUu4EkoxYDPJeCxhjU4HkYSZ/HpLNbIJ9AOOg== X-Received: by 2002:a17:902:a410:: with SMTP id p16mr17723995plq.150.1566389394293; Wed, 21 Aug 2019 05:09:54 -0700 (PDT) Received: from [192.168.1.188] (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id z4sm22521476pfg.166.2019.08.21.05.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 05:09:53 -0700 (PDT) Subject: Re: [PATCH 5/9] block: support diskcipher To: "boojin.kim" , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: '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 References: <004101d557eb$98b00060$ca100120$@samsung.com> From: Jens Axboe Message-ID: <6ea5e5db-4dd4-719f-3b3e-b89099636ea6@kernel.dk> Date: Wed, 21 Aug 2019 06:09:50 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <004101d557eb$98b00060$ca100120$@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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