Skip to contentSkip to conversation

add identifying information in INTEGRITY AEAD ERROR message

PATCH In review Erich Eckner 3 participants 3 messages May 14, 2019 – May 16, 2019 Device mapper

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I have a bunch of dm integrity devices tied together to an md raid. Now I see the following error message in dmesg:

device-mapper: crypt: INTEGRITY AEAD ERROR, sector 1109341168

repeated a couple of times every few seconds in a row with differing sector numbers. There are no other errors in dmesg next to these. As I understand, this means, one of the drives deliveres garbage to the integrity device which hence issues a read error. (There is an e2fsck running on the raid which generates a lot of disk i/o.) That's good - it's exactly what I intended this integrity thing for.

My problem now is, that I would like to find out which of my 10 drives is the bad one. Is there any way to get some identifying information (a uuid, the name of the device in /dev/mapper/, ...)?

ah, the usual statistics:

Quoted 1 line

uname -a

Linux fileserver 5.1.0 #56 SMP Tue May 7 06:24:43 CEST 2019 x86_64 Intel(R) Pentium(R) CPU G2020 @ 2.90GHz GenuineIntel GNU/Linux

Quoted 1 line

zgrep INTEGRITY /proc/config.gz

CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_DM_INTEGRITY=y
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
CONFIG_INTEGRITY=y
# CONFIG_INTEGRITY_SIGNATURE is not set
CONFIG_INTEGRITY_AUDIT=y

The kernel is manually compiled - I'm happy to activate any options you deem necessary.

regards,
Erich Eckner
Friedrich-Schiller-Universität Jena
Institut für Optik und Quantenelektronik
Helmholtzweg 4
07743 Jena

Tel. +49 3641 9-47238

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE3p92iMrPBP64GmxZCu7JB1Xae1oFAlzajwAACgkQCu7JB1Xa e1rQ2g/9HVoQcSwhKxLW6w7wy8rgUlHBt/DbWxeHM6KTkss5yxrVNUkv1TGXop9l krDMKvhpNxI29IrhvSgqSbtJw0sk9iJU0urFsrs09TK6ATvcUtO5X8CLnPULqBqC YnnygcBgVt16FgoaAMVSyx2qEGrO5DXzquqLlJAa2z0+ZZGWa/5Nrhm3nfbHBbQQ pjiNpk+iNVbGIhe8+tR+vOZfJaghrA3B9W7FyYARlfB1Gy4S/DM5im2HTw/2ESJp nkSprpxiq5WyN56tFKnCrZSwe2Ga4NCNP6h8Gz7ynKlpbziXMey8BP3Puvfh7UNa Blcz648/3RwqfKkGqrY2mypo6DyiWribHr0A8Uza/RWVERbg0U9o1DdZ6DKbbnSm MKfAuSKBE2WErHrfwNN7WGOK/xlonkR8oADcaLI8db1Xu4Stj1HqA5lB9aT+K9KP kJFnc1254qJ+LvQHJfPTsW8sKgqwIfccNONltta/BCJCgcDl79y0VL9WX/dJS6Pu xqSSejPJ7Fp+gpR+FZbllWn+rCGF+JY6dku5oObp5uZOlfwQg8+zAhf4TQLYJmn0 dzgaqonpzzmEGHUw31/R2Km0aHtuEsTCW986Gx9taWY84JyQDRSXjAXHsxJCMtN3 rpMbDemoSRz6/WnI48VauN2obeUS3dmQraV+MNPpGiJmt86XM0o= =YfBa
-----END PGP SIGNATURE-----

#1 lore raw

PATCH 1/2 dm-crypt: print device name in integrity error message.

This message should better identify the device with the integrity failure.

---
 drivers/md/dm-crypt.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/md/dm-crypt.c +6 -3
index 7f6462f74ac8..36dfa36505ed 100644
@@ -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)
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH 1/2] dm-crypt: print device name in integrity error message.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

thanks for the fast patch - I applied it on top of 5.1.2 and it has the desired result. (It took some time to trigger the read errors, though ;-b):

[ 8834.156713] device-mapper: crypt: dm-17: INTEGRITY AEAD ERROR, sector 1595877368
[ 9713.463619] device-mapper: crypt: dm-17: INTEGRITY AEAD ERROR, sector 1595877040

regards,
Erich Eckner
Friedrich-Schiller-Universität Jena
Institut für Optik und Quantenelektronik
Helmholtzweg 4
07743 Jena

Tel. +49 3641 9-47238

Quoted 43 lines · Milan Broz

This message should better identify the device with the integrity failure.

---
drivers/md/dm-crypt.c | 9 ++++++---

1 file changed, 6 insertions(+), 3 deletions(-)
drivers/md/dm-crypt.c +6 -3
index 7f6462f74ac8..36dfa36505ed 100644
@@ -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)
Signature · 6 lines
2.20.1

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE3p92iMrPBP64GmxZCu7JB1Xae1oFAlzdJ6cACgkQCu7JB1Xa e1raZQ/+PbM9H3gLyVYsUMw5uNA5galb88AD7vkHbSGRrERjZiDIDFvA35wLnBQt /K+GKvFnPiM3qlceYCRYTEfPVO/8SRPDkGg8h55ArdmGpgWUfagvFCJYiJKe7gRu SMjOXMYkA0187jB5YarEbCSYEDsrJr8wtBfwlHYgQ7pMbU6ua/l6KHGPG3abznZ9 PC6US1y6QX3lrMqZwKmdfijZGIlJ8Tf1KdagTMZbDs74MTpzLwOoNdQbNLv/yA3o PLpXSrbPXZnVkL6VWpjBfCwgjFSqPlScwqwgDZJRbtiSmsOcTFtDke974KMoGMTe MfnXe0YTMu4TvP1wAuDk3SztTw59RsAnTjS1JUkR11fjV1uZgTqkPtmm21XpI9Op mMVCPjcCVq96uYT4CkY17B4Ukj4VT0rFb/47WKpcl66jvC4q3rIdnq9124IClnEw eWZAz6KDLb6q3Z7/k3lSpSXmc9yQMBsOrzCMHv36N62RfoDFV8139gw5PjZNgnRm KUX9SUSw+nPpUvcqajJwb7LJDf+jueCG6rhzQVGknvt693YQ49gWwgsheoT+d8fS YBQgSq4ZNV5tGHBgfm6qOEi2/JTnyBl8b41IOarh/aYjLILyg6cTSU0FevT2eii+ JeRQtJCsoDl4FmhCXKd9+DHB+vTZ9h3ZRizIx6+Sm9uNcqDOVs0= =lei7
-----END PGP SIGNATURE-----