From patchwork Wed May 15 14:22:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 10944863 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B1051398 for ; Wed, 15 May 2019 14:26:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AFEA28ABE for ; Wed, 15 May 2019 14:26:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F85228BB0; Wed, 15 May 2019 14:26:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D7E628BA7 for ; Wed, 15 May 2019 14:26:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31F303002F52; Wed, 15 May 2019 14:26:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3BEB600D4; Wed, 15 May 2019 14:26:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8A14218089CB; Wed, 15 May 2019 14:26:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4FENlpY031678 for ; Wed, 15 May 2019 10:23:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6F8191001E98; Wed, 15 May 2019 14:23:47 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AD351001E85 for ; Wed, 15 May 2019 14:23:45 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58FD081F0F for ; Wed, 15 May 2019 14:23:29 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id y3so244639wmm.2 for ; Wed, 15 May 2019 07:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2lBBa4mFrf4BDSerLLwmpoWld8SlPCYkgjPWqmg5mOc=; b=UiVR3IVBbV+4Nax7B39QUpAwWFybvr6mYmvlrkDaMuDgRRga6m6yznLo6mkfnVfEk9 2DggL5Cefte84qm5Swikm+MamHqLASEbjXh6cGi3jdK2k1RMnDO8QxjcCk9oGFn+2z83 3Zcy7fczV1sdy9gSbSgy8dNfD9N0A/zWR8eVIY5EbX41DNcAwCqnIb0/Wp5XGKMANhp0 HmLhLiaIuczUHP+/uXDpgIOss1ovDy+SQ9Dpplb+86bV6CF9uIxs5wems+EkL4LmpDN3 6UNYabpW7M97evD+i584PuP1/AcJBuG+/E+PRecjW3FjIuQjZOMj+Fh7JwC3+/6wyzuW hySw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2lBBa4mFrf4BDSerLLwmpoWld8SlPCYkgjPWqmg5mOc=; b=eEsVPXxoi+tCcOS7u8aL5l0omwkYG5UTULvESKTZfB9Oj3bQuaHMPCp2cB0rmbNb+x RwreYPSMgGvn07aDIgbydkimziqk/uDtMy7TPBywp/h1aGdQbJEbOUsvg7XNK8lzEfso ZrUoX5rPDqpelyywbEuXQmmqpReNPXdkjlsuGxBS9ZXo3TB64vjmGJYc1tSltr3/jSmc eQgya6SG9PNGytk8BQbXkLiMnNmZWM6B1+2FdrwGdn9TAPzqiySIXMBunql7WNdVHhvz av2HP2O/Yd2Bg5GXjfd0w9Q63AM5r3EYPk/90p+5rPbsljQhLi/mQfcQcIhRq6X7JA+9 VSBQ== X-Gm-Message-State: APjAAAU27C0foOe4MoouseOaPnI51RdWrZx1AOCdihiDuRqSFk+k1sgy Z1HRz9TngQyNgYEaJPCFkr4FVTiq X-Google-Smtp-Source: APXvYqz11kw4GPNbhOOX44hNIbrEI0IhUe6f1TJiqnfaUTKfealZzRze/ikRU3+lPplFAlNwtHSzGg== X-Received: by 2002:a1c:f50a:: with SMTP id t10mr22577489wmh.86.1557930207709; Wed, 15 May 2019 07:23:27 -0700 (PDT) Received: from merlot.mazyland.net (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.googlemail.com with ESMTPSA id x18sm2430257wrw.14.2019.05.15.07.23.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 07:23:26 -0700 (PDT) From: Milan Broz To: dm-devel@redhat.com Date: Wed, 15 May 2019 16:22:30 +0200 Message-Id: <20190515142231.30590-1-gmazyland@gmail.com> In-Reply-To: References: MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 15 May 2019 14:23:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 15 May 2019 14:23:29 +0000 (UTC) for IP:'209.85.128.65' DOMAIN:'mail-wm1-f65.google.com' HELO:'mail-wm1-f65.google.com' FROM:'gmazyland@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.1 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_PASS) 209.85.128.65 mail-wm1-f65.google.com 209.85.128.65 mail-wm1-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: dm-devel@redhat.com Cc: Milan Broz Subject: [dm-devel] [PATCH 1/2] dm-crypt: print device name in integrity error message. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 15 May 2019 14:26:11 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP This message should better identify the device with the integrity failure. Signed-off-by: Milan Broz --- drivers/md/dm-crypt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 7f6462f74ac8..36dfa36505ed 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1143,9 +1143,11 @@ static int crypt_convert_block_aead(struct crypt_config *cc, r = crypto_aead_decrypt(req); } - if (r == -EBADMSG) - DMERR_LIMIT("INTEGRITY AEAD ERROR, sector %llu", + if (r == -EBADMSG) { + char b[BDEVNAME_SIZE]; + DMERR_LIMIT("%s: INTEGRITY AEAD ERROR, sector %llu", bio_devname(ctx->bio_in, b), (unsigned long long)le64_to_cpu(*sector)); + } if (!r && cc->iv_gen_ops && cc->iv_gen_ops->post) r = cc->iv_gen_ops->post(cc, org_iv, dmreq); @@ -1788,7 +1790,8 @@ static void kcryptd_async_done(struct crypto_async_request *async_req, error = cc->iv_gen_ops->post(cc, org_iv_of_dmreq(cc, dmreq), dmreq); if (error == -EBADMSG) { - DMERR_LIMIT("INTEGRITY AEAD ERROR, sector %llu", + char b[BDEVNAME_SIZE]; + DMERR_LIMIT("%s: INTEGRITY AEAD ERROR, sector %llu", bio_devname(ctx->bio_in, b), (unsigned long long)le64_to_cpu(*org_sector_of_dmreq(cc, dmreq))); io->error = BLK_STS_PROTECTION; } else if (error < 0) From patchwork Wed May 15 14:23:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 10944861 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C683692A for ; Wed, 15 May 2019 14:25:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B441E27968 for ; Wed, 15 May 2019 14:25:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B265D28AF7; Wed, 15 May 2019 14:25:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 459BC28B04 for ; Wed, 15 May 2019 14:25:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2D098F91C; Wed, 15 May 2019 14:25:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E76C600D4; Wed, 15 May 2019 14:25:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D39664BB43; Wed, 15 May 2019 14:25:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4FENwxm031689 for ; Wed, 15 May 2019 10:23:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id D92525D9D0; Wed, 15 May 2019 14:23:58 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D422A5D9C3 for ; Wed, 15 May 2019 14:23:56 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EA08F149A2 for ; Wed, 15 May 2019 14:23:52 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id x64so225359wmb.5 for ; Wed, 15 May 2019 07:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PPSv5QXz/0gm0VMjwMbO1+FpQXQ/lI/x4fCz9S2kv+U=; b=i1dXCJ/hdl+lCzlQfG7q13Qv2OyTJgWYyJhqx0rY98eJKtdPX42OilBY17Hu06dbVk XBSyUAI5Y+KiIFMz8XVcNQnkGBGjjMSEQOowAuLqy3S1Y9iGvukGuGj1FB2ppT+5REwl M7Zcb2Ss75mmmjRKt4J+2hWCN6B76K+lRFavt2KK5+6As7xGdErFyixIuJPHAi/9CIMP RdMdh+sImSrZIaXlxTw+lYGk/WxZthmS+MGKbcWN3c0F+OEOAPveMyw/Aefwfv5dlTz5 RYZUUJ6V5Xg6sCFpUaSYHUeLqnMuJ6OA4R6/Uapg9ixt4WWGpc+B3fn65iCbYaLM3MPP 39kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PPSv5QXz/0gm0VMjwMbO1+FpQXQ/lI/x4fCz9S2kv+U=; b=rXVg/9N52iL9GwvI8Kvug2Jy7Zj6hQLygddkav/UM1Wz0PN2gwanSkXEPPK6TyQnmQ JTf6+5ZDjxl2Z/OKuNC8UYONbrh3blf6hD+/9wIYU4iZgteqbce1BfrdvMstoI/Qn0bz pZBWMplr5pVOc8/8FKOBi6g7uiu02CXgiEmEdZNpL4y09qciqGH5WIqFCbIV9gPDzhVO qn5v/lNunIZagZcV1voIHHEZZrccqQ6S4qUihY/7NAHx91eLqBhZuNG3QLyR6Kx6k3I8 D3uV4Kt/iZc3J52luB5RUsgcnUk3CNAY3oZYTaZAEcoKvIKUGKzNw/FBBTuoYquzzrqA za7g== X-Gm-Message-State: APjAAAVqBEllgoLbmQGvBcHGXJdHdxpnNl3gWYCegR70KXf1Hkq0y/HR nQDX3xG1nyFPCe0xi4U5MztfxJXe X-Google-Smtp-Source: APXvYqwqxWKVU90FezQSCNkpzHGwPDvhMhMVL9es8c8W6uAQY294BoxHsPFNLWeiAX73vffPTb2zaQ== X-Received: by 2002:a1c:720b:: with SMTP id n11mr22652774wmc.81.1557930231353; Wed, 15 May 2019 07:23:51 -0700 (PDT) Received: from merlot.mazyland.net (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.googlemail.com with ESMTPSA id v184sm3015093wma.6.2019.05.15.07.23.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 07:23:50 -0700 (PDT) From: Milan Broz To: dm-devel@redhat.com Date: Wed, 15 May 2019 16:23:43 +0200 Message-Id: <20190515142343.30641-1-gmazyland@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 15 May 2019 14:23:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 15 May 2019 14:23:53 +0000 (UTC) for IP:'209.85.128.68' DOMAIN:'mail-wm1-f68.google.com' HELO:'mail-wm1-f68.google.com' FROM:'gmazyland@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.68 mail-wm1-f68.google.com 209.85.128.68 mail-wm1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com Cc: Milan Broz Subject: [dm-devel] [PATCH 2/2] dm-crypt: move detailed message into debug level. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 15 May 2019 14:25:20 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP The information about tag size should not be printed without debug info set. Also pront device major:minor in the error message to identify the device instance. Also use rate limiting and debug level for info about used crypto API implementaton. (During online reencryption this message saturates syslog, because we are moving hotzone across the whole device.) Signed-off-by: Milan Broz --- drivers/md/dm-crypt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 36dfa36505ed..af017d044dc0 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -946,6 +946,7 @@ static int crypt_integrity_ctr(struct crypt_config *cc, struct dm_target *ti) { #ifdef CONFIG_BLK_DEV_INTEGRITY struct blk_integrity *bi = blk_get_integrity(cc->dev->bdev->bd_disk); + struct mapped_device *md = dm_table_get_md(ti->table); /* From now we require underlying device with our integrity profile */ if (!bi || strcasecmp(bi->profile->name, "DM-DIF-EXT-TAG")) { @@ -965,7 +966,7 @@ static int crypt_integrity_ctr(struct crypt_config *cc, struct dm_target *ti) if (crypt_integrity_aead(cc)) { cc->integrity_tag_size = cc->on_disk_tag_size - cc->integrity_iv_size; - DMINFO("Integrity AEAD, tag size %u, IV size %u.", + DMDEBUG("%s: Integrity AEAD, tag size %u, IV size %u.", dm_device_name(md), cc->integrity_tag_size, cc->integrity_iv_size); if (crypto_aead_setauthsize(any_tfm_aead(cc), cc->integrity_tag_size)) { @@ -973,7 +974,7 @@ static int crypt_integrity_ctr(struct crypt_config *cc, struct dm_target *ti) return -EINVAL; } } else if (cc->integrity_iv_size) - DMINFO("Additional per-sector space %u bytes for IV.", + DMDEBUG("%s: Additional per-sector space %u bytes for IV.", dm_device_name(md), cc->integrity_iv_size); if ((cc->integrity_tag_size + cc->integrity_iv_size) != bi->tag_size) { @@ -1890,7 +1891,7 @@ static int crypt_alloc_tfms_skcipher(struct crypt_config *cc, char *ciphermode) * algorithm implementation is used. Help people debug performance * problems by logging the ->cra_driver_name. */ - DMINFO("%s using implementation \"%s\"", ciphermode, + DMDEBUG_LIMIT("%s using implementation \"%s\"", ciphermode, crypto_skcipher_alg(any_tfm(cc))->base.cra_driver_name); return 0; } @@ -1910,7 +1911,7 @@ static int crypt_alloc_tfms_aead(struct crypt_config *cc, char *ciphermode) return err; } - DMINFO("%s using implementation \"%s\"", ciphermode, + DMDEBUG_LIMIT("%s using implementation \"%s\"", ciphermode, crypto_aead_alg(any_tfm_aead(cc))->base.cra_driver_name); return 0; }