[linux] 01/01: crypto: {blk,giv}cipher: Set has_setkey (avoids regressing cryptsetup; see #815480)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun Mar 6 21:29:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch jessie
in repository linux.

commit eb31cf59c90484997282b06dba105f199a2c7807
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sun Mar 6 21:27:36 2016 +0000

    crypto: {blk,giv}cipher: Set has_setkey (avoids regressing cryptsetup; see #815480)
---
 debian/changelog                                   |  2 ++
 .../all/crypto-blk-giv-cipher-set-has_setkey.patch | 32 ++++++++++++++++++++++
 .../crypto-fix-abi-change-in-3.16.7-ckt25.patch    | 23 +++++++++++++---
 debian/patches/series                              |  1 +
 4 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5ecb909..82a1a08 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -637,6 +637,8 @@ linux (3.16.7-ckt25-1) UNRELEASED; urgency=medium
   * udeb: Add dm-service-time to multipath-modules (Closes: #806131)
   * net: Ignore ABI changes due to "ipv6: add complete rcu protection around
     np->opt", which don't appear to affect out-of-tree modules
+  * crypto: {blk,giv}cipher: Set has_setkey (avoids regressing cryptsetup;
+    see #815480)
 
   [ Aurelien Jarno ]
   * [mips*] Add support for MIPS 5KE CPU.
diff --git a/debian/patches/bugfix/all/crypto-blk-giv-cipher-set-has_setkey.patch b/debian/patches/bugfix/all/crypto-blk-giv-cipher-set-has_setkey.patch
new file mode 100644
index 0000000..deef666
--- /dev/null
+++ b/debian/patches/bugfix/all/crypto-blk-giv-cipher-set-has_setkey.patch
@@ -0,0 +1,32 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sun, 06 Mar 2016 19:52:46 +0000
+Subject: crypto: {blk,giv}cipher: Set has_setkey
+
+Commit a1383cd86a06 ("crypto: skcipher - Add crypto_skcipher_has_setkey")
+was incorrectly backported to the 3.2.y and 3.16.y stable branches.
+We need to set ablkcipher_tfm::has_setkey in the
+crypto_init_blkcipher_ops_async() and crypto_init_givcipher_ops()
+functions as well as crypto_init_ablkcipher_ops().
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+--- a/crypto/ablkcipher.c
++++ b/crypto/ablkcipher.c
+@@ -457,6 +457,7 @@ static int crypto_init_givcipher_ops(str
+ 	crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt;
+ 	crt->base = __crypto_ablkcipher_cast(tfm);
+ 	crt->ivsize = alg->ivsize;
++	crt->has_setkey = alg->max_keysize;
+ 
+ 	return 0;
+ }
+--- a/crypto/blkcipher.c
++++ b/crypto/blkcipher.c
+@@ -471,6 +471,7 @@ static int crypto_init_blkcipher_ops_asy
+ 	}
+ 	crt->base = __crypto_ablkcipher_cast(tfm);
+ 	crt->ivsize = alg->ivsize;
++	crt->has_setkey = alg->max_keysize;
+ 
+ 	return 0;
+ }
diff --git a/debian/patches/debian/crypto-fix-abi-change-in-3.16.7-ckt25.patch b/debian/patches/debian/crypto-fix-abi-change-in-3.16.7-ckt25.patch
index ee01687..0879174 100644
--- a/debian/patches/debian/crypto-fix-abi-change-in-3.16.7-ckt25.patch
+++ b/debian/patches/debian/crypto-fix-abi-change-in-3.16.7-ckt25.patch
@@ -22,6 +22,14 @@ crypto_{ahash,ablkcipher}_has_setkey() functions.
  
  	return 0;
  }
+@@ -457,7 +456,6 @@ static int crypto_init_givcipher_ops(str
+ 	crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt;
+ 	crt->base = __crypto_ablkcipher_cast(tfm);
+ 	crt->ivsize = alg->ivsize;
+-	crt->has_setkey = alg->max_keysize;
+ 
+ 	return 0;
+ }
 --- a/crypto/ahash.c
 +++ b/crypto/ahash.c
 @@ -444,7 +444,6 @@ static int crypto_ahash_init_tfm(struct
@@ -114,21 +122,28 @@ crypto_{ahash,ablkcipher}_has_setkey() functions.
  };
  
  struct aead_tfm {
-@@ -667,9 +666,18 @@ static inline int crypto_ablkcipher_setk
+@@ -667,9 +666,25 @@ static inline int crypto_ablkcipher_setk
  
  static inline bool crypto_ablkcipher_has_setkey(struct crypto_ablkcipher *tfm)
  {
 -	struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(tfm);
 +	struct crypto_tfm *basetfm = crypto_ablkcipher_tfm(tfm);
- 
--	return crt->has_setkey;
++
 +	switch (crypto_tfm_alg_type(basetfm)) {
-+	case CRYPTO_ALG_TYPE_ABLKCIPHER: {
++	case CRYPTO_ALG_TYPE_ABLKCIPHER:
++	case CRYPTO_ALG_TYPE_GIVCIPHER: {
 +		struct ablkcipher_alg *alg = &basetfm->__crt_alg->cra_ablkcipher;
 +
 +		return alg->max_keysize != 0;
 +	}
 +
++	case CRYPTO_ALG_TYPE_BLKCIPHER: {
++		struct blkcipher_alg *alg = &basetfm->__crt_alg->cra_blkcipher;
++
++		return alg->max_keysize != 0;
++	}
+ 
+-	return crt->has_setkey;
 +	default:
 +		return false;
 +	}
diff --git a/debian/patches/series b/debian/patches/series
index 482e41b..b37ec30 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -651,4 +651,5 @@ bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch
 bugfix/all/aio-properly-check-iovec-sizes.patch
 debian/enclosure-fix-abi-change-in-3.16.7-ckt23.patch
 debian/revert-cgroup-make-sure-a-parent-css-isn-t-offlined.patch
+bugfix/all/crypto-blk-giv-cipher-set-has_setkey.patch
 debian/crypto-fix-abi-change-in-3.16.7-ckt25.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list