linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PROBLEM: unable to decrypt LUKS partition since v4.9-rc6 (bisected)
@ 2016-11-21  6:56 Patrick Steinhardt
  2016-11-21  7:34 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Steinhardt @ 2016-11-21  6:56 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: linux-crypto

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROBLEM: unable to decrypt LUKS partition since v4.9-rc6 (bisected)
  2016-11-21  6:56 PROBLEM: unable to decrypt LUKS partition since v4.9-rc6 (bisected) Patrick Steinhardt
@ 2016-11-21  7:34 ` Herbert Xu
  2016-11-21  7:43   ` Patrick Steinhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2016-11-21  7:34 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: David S. Miller, linux-crypto

On Mon, Nov 21, 2016 at 07:56:38AM +0100, Patrick Steinhardt wrote:
> 
> 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")
Reported-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index 05e21b4..d19b09c 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -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);
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: PROBLEM: unable to decrypt LUKS partition since v4.9-rc6 (bisected)
  2016-11-21  7:34 ` Herbert Xu
@ 2016-11-21  7:43   ` Patrick Steinhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Steinhardt @ 2016-11-21  7:43 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, linux-crypto

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On Mon, Nov 21, 2016 at 03:34:00PM +0800, Herbert Xu wrote:
> On Mon, Nov 21, 2016 at 07:56:38AM +0100, Patrick Steinhardt wrote:
> > 
> > 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!
[snip]

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

Regards
Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-21  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21  6:56 PROBLEM: unable to decrypt LUKS partition since v4.9-rc6 (bisected) Patrick Steinhardt
2016-11-21  7:34 ` Herbert Xu
2016-11-21  7:43   ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).