Skip to contentSkip to conversation

PROBLEM: unable to decrypt LUKS partition since v4.9-rc6 (bisected)

DISCUSSION Patrick Steinhardt 2 participants 3 messages Nov 21, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

Hi,

I'm using cryptsetup 1.7.2 via the kernel's crypto API. Since version v4.9-rc6, I'm unable to decrypt my LUKS partitions (aes-xts-plain64, sha512). cryptsetup simply aborts with the message "No such passphrase available" after inputting the passphrase.

After bisecting the issue, this points to commit a8348bc (crypto:
algif_hash - Fix NULL hash crash with shash, 2016-11-17). After reverting this particular commit, everything works correctly again.

Please let me know if you need additional information.

Regards
Patrick

maintainer
#1 lore raw
Quoted 11 lines · Patrick Steinhardt

I'm using cryptsetup 1.7.2 via the kernel's crypto API. Since version v4.9-rc6, I'm unable to decrypt my LUKS partitions (aes-xts-plain64, sha512). cryptsetup simply aborts with the message "No such passphrase available" after inputting the passphrase.

After bisecting the issue, this points to commit a8348bc (crypto:
algif_hash - Fix NULL hash crash with shash, 2016-11-17). After reverting this particular commit, everything works correctly again.

Sorry, I screwed up that patch. Please try the following fix. Thanks!

---8<---
crypto: algif_hash - Fix result clobbering in recvmsg

Recently an init call was added to hash_recvmsg so as to reset the hash state in case a sendmsg call was never made.

Unfortunately this ended up clobbering the result if the previous sendmsg was done with a MSG_MORE flag. This patch fixes it by excluding that case when we make the init call.

Fixes a8348bca2944 ("algif_hash - Fix NULL hash crash with shash")
crypto/algif_hash.c +1 -1
index 05e21b4..d19b09c 100644
@@ -214,7 +214,7 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 
 	ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0);
 
-	if (!result) {
+	if (!result && !ctx->more) {
 		err = af_alg_wait_for_completion(
 				crypto_ahash_init(&ctx->req),
 				&ctx->completion);
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 8 lines · Herbert Xu
Quoted 7 lines · Patrick Steinhardt

I'm using cryptsetup 1.7.2 via the kernel's crypto API. Since version v4.9-rc6, I'm unable to decrypt my LUKS partitions (aes-xts-plain64, sha512). cryptsetup simply aborts with the message "No such passphrase available" after inputting the passphrase.

Quoted 7 lines
Quoted 4 lines

After bisecting the issue, this points to commit a8348bc (crypto:
algif_hash - Fix NULL hash crash with shash, 2016-11-17). After reverting this particular commit, everything works correctly again.

Sorry, I screwed up that patch. Please try the following fix. Thanks!

[snip]

Thanks for the fast response. Your patch fixes the problem.

Regards
Patrick