Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4916060imm; Mon, 11 Jun 2018 22:40:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLT7RjQtRpkyoDtb36PQVgF4uKPy81IHFVJ7uxcKitKekS1nKzQXwSskJr0BvIEmjuSHEij X-Received: by 2002:a17:902:d807:: with SMTP id a7-v6mr2466596plz.92.1528782012977; Mon, 11 Jun 2018 22:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528782012; cv=none; d=google.com; s=arc-20160816; b=OtZjSatae1MiU0XlbapjMrRVok7tYAY2x12QoYD23hFXW/2pDZptqCQ6bsgnvhq3XC gVPX7GMZXa/YdLgUx9iJOYi8JdBLZ7qsgJMa6WXU93asNfqoAGvRIMEMT61MoXJQ3Lfz yFHXb49Dw6zNzmJV0JhS+Tz9enTEz2FK2Nof3dNwdTLHcZ5gAsCnhIHSQjN8haFE6VnH QFZ36nEbkYH9xP5CemCNu00JlCGOOxEzGV9agbxm+lCX37S4Hzsb9+yukEI4+Isbn7hV b0Gta6FZOk08RpqOxe3n6FbV71fKy+Ze7oAGhknOqokADW7M6ybW5oj9XeSXhv7S4SsA KvgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=YDfH1GxjOe2gHAeoM8hRU1BF+eox76Bwq8yHKLuTemo=; b=o4xMIjFfmLApXMr+8oPRQmNruoxzWzA/WWNba5+k2X4MybM/ONZk3sJwsh50U5GThX Dr/jF8FL8b48OxCt3sQa/+LJHV7m2RfG3fjjkhp+u1py3xrcPSNuOqSzcHtDUJuhXWJW MWQ7SbTn2mDLh3PvSY9xQGpC1euAQ0TqbAxtnO4+TwzKsHKr7pbnJKBR4BnBbd1VNSpW DL7AvuYaKkGRBwoGXdq02WzXwcwiu87PGCs/HDqNk4HNyi9HIMP2dU/FJ7yZVj1q0hBr 35+j+/5dhI/bO9PaCoZWFZJECCudXs/PuXn1fQM59vVzDFxbYnyw2xzBP58CUSEPZVw0 8zQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6-v6si88571pll.24.2018.06.11.22.39.58; Mon, 11 Jun 2018 22:40:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933032AbeFLFiM (ORCPT + 99 others); Tue, 12 Jun 2018 01:38:12 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:54792 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932448AbeFLFiL (ORCPT ); Tue, 12 Jun 2018 01:38:11 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B14ED7ABF6030; Tue, 12 Jun 2018 13:38:00 +0800 (CST) Received: from [127.0.0.1] (10.184.52.56) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.382.0; Tue, 12 Jun 2018 13:37:54 +0800 To: , , CC: , , , , , From: Xiongfeng Wang Subject: [Query] Failed to create dm-crypt device when using AEAD type Message-ID: <33220afd-9a26-6133-ebf0-83b1268c34b7@huawei.com> Date: Tue, 12 Jun 2018 13:37:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.184.52.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dm-crypt maintainers, Recently, I was testing the dm-crypt, but I failed to create dm-crypt device when using AEAD type. I would really appreciate it if you could give some help. The error info is as follows: localhost:~ # export SIZE_INT=997376 8 J 0"ost:~ # dmsetup create integ1 --table "0 $SIZE_INT integrity /dev/sdd2 0 2 localhost:~ # dom \host:~ # dmsetup create crypt1 --table "0 $SIZE_INT crypt capi:gcm(aes)-ran > 11ff33c6fb942655efb3e30cf4c0fd95f5ef483afca72166c530ae26151dd83b \ > 0 /dev/mapper/integ1 0 1 integrity:28:aead" [ 1746.631559] device-mapper: crypt: Integrity AEAD, tag size 16, IV size 12. [ 1746.649796] device-mapper: crypt: INTEGRITY AEAD ERROR, sector 997248 [ 1746.656382] device-mapper: crypt: INTEGRITY AEAD ERROR, sector 997248 [ 1746.662826] Buffer I/O error on dev dm-3, logical block 124656, async page read I tested it both on qemu and hardware, and it printed the same error. The error seems always on the last several sectors within the SIZE_INT I designated. When I change the SIZE_INT, the error sector num also change. I think something went wrong in the software, not the hardware. My board don't have AEAD accelerator, so it uses the software implemented cipher. My kernel version is 4.17-rc3. The command is as follows: export SIZE_INT=997376 dmsetup create integ1 --table "0 $SIZE_INT integrity /dev/sdd2 0 28 J 0" dmsetup create crypt1 --table "0 $SIZE_INT crypt capi:gcm(aes)-random \ 11ff33c6fb942655efb3e30cf4c0fd95f5ef483afca72166c530ae26151dd83b \ 0 /dev/mapper/integ1 0 1 integrity:28:aead" This command comes from the commit information of the commit which introduce AEAD. (commit ef43aa38063a6b2b3c6618e28ab35794f4f1fe29 dm crypt: add cryptographic data integrity protection (authenticated encryption)) I only change 'aes-gcm-random' to 'capi:gcm(aes)-random' Really appreciate it if you could have a look at it, Thanks! Regards, Xiongfeng