diff mbox

[Xenial,SRU] crypto: vmx - IV size failing on skcipher API

Message ID 1467040322-20692-1-git-send-email-tim.gardner@canonical.com
State New
Headers show

Commit Message

Tim Gardner June 27, 2016, 3:12 p.m. UTC
From: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>

BugLink: http://bugs.launchpad.net/bugs/1596557

IV size was zero on CBC and CTR modes,
causing a bug triggered by skcipher.

Fixing this  adding a correct size.

Signed-off-by: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Signed-off-by: Paulo Smorigo <pfsmorigo@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 0d3d054b43719ef33232677ba27ba6097afdafbc)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/crypto/vmx/aes_cbc.c | 2 +-
 drivers/crypto/vmx/aes_ctr.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Colin Ian King June 27, 2016, 3:22 p.m. UTC | #1
On 27/06/16 16:12, Tim Gardner wrote:
> From: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1596557
> 
> IV size was zero on CBC and CTR modes,
> causing a bug triggered by skcipher.
> 
> Fixing this  adding a correct size.
> 
> Signed-off-by: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
> Signed-off-by: Paulo Smorigo <pfsmorigo@linux.vnet.ibm.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> (cherry picked from commit 0d3d054b43719ef33232677ba27ba6097afdafbc)
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  drivers/crypto/vmx/aes_cbc.c | 2 +-
>  drivers/crypto/vmx/aes_ctr.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/vmx/aes_cbc.c b/drivers/crypto/vmx/aes_cbc.c
> index f3801b9..3f8bb9a 100644
> --- a/drivers/crypto/vmx/aes_cbc.c
> +++ b/drivers/crypto/vmx/aes_cbc.c
> @@ -191,7 +191,7 @@ struct crypto_alg p8_aes_cbc_alg = {
>  	.cra_init = p8_aes_cbc_init,
>  	.cra_exit = p8_aes_cbc_exit,
>  	.cra_blkcipher = {
> -			  .ivsize = 0,
> +			  .ivsize = AES_BLOCK_SIZE,
>  			  .min_keysize = AES_MIN_KEY_SIZE,
>  			  .max_keysize = AES_MAX_KEY_SIZE,
>  			  .setkey = p8_aes_cbc_setkey,
> diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c
> index 404a1b6..72f1389 100644
> --- a/drivers/crypto/vmx/aes_ctr.c
> +++ b/drivers/crypto/vmx/aes_ctr.c
> @@ -175,7 +175,7 @@ struct crypto_alg p8_aes_ctr_alg = {
>  	.cra_init = p8_aes_ctr_init,
>  	.cra_exit = p8_aes_ctr_exit,
>  	.cra_blkcipher = {
> -			  .ivsize = 0,
> +			  .ivsize = AES_BLOCK_SIZE,
>  			  .min_keysize = AES_MIN_KEY_SIZE,
>  			  .max_keysize = AES_MAX_KEY_SIZE,
>  			  .setkey = p8_aes_ctr_setkey,
> 
Looks sensible to me, clean upstream cherry pick.

Acked-by: Colin Ian King <colin.king@canonical.com>
Stefan Bader June 28, 2016, 9:24 a.m. UTC | #2
Looks reasonable and is a cherry-pick. Should also be simple to verify.

-Stefan
Brad Figg June 28, 2016, 2:27 p.m. UTC | #3
On Mon, Jun 27, 2016 at 09:12:02AM -0600, Tim Gardner wrote:
> From: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1596557
> 
> IV size was zero on CBC and CTR modes,
> causing a bug triggered by skcipher.
> 
> Fixing this  adding a correct size.
> 
> Signed-off-by: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
> Signed-off-by: Paulo Smorigo <pfsmorigo@linux.vnet.ibm.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> (cherry picked from commit 0d3d054b43719ef33232677ba27ba6097afdafbc)
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  drivers/crypto/vmx/aes_cbc.c | 2 +-
>  drivers/crypto/vmx/aes_ctr.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/vmx/aes_cbc.c b/drivers/crypto/vmx/aes_cbc.c
> index f3801b9..3f8bb9a 100644
> --- a/drivers/crypto/vmx/aes_cbc.c
> +++ b/drivers/crypto/vmx/aes_cbc.c
> @@ -191,7 +191,7 @@ struct crypto_alg p8_aes_cbc_alg = {
>  	.cra_init = p8_aes_cbc_init,
>  	.cra_exit = p8_aes_cbc_exit,
>  	.cra_blkcipher = {
> -			  .ivsize = 0,
> +			  .ivsize = AES_BLOCK_SIZE,
>  			  .min_keysize = AES_MIN_KEY_SIZE,
>  			  .max_keysize = AES_MAX_KEY_SIZE,
>  			  .setkey = p8_aes_cbc_setkey,
> diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c
> index 404a1b6..72f1389 100644
> --- a/drivers/crypto/vmx/aes_ctr.c
> +++ b/drivers/crypto/vmx/aes_ctr.c
> @@ -175,7 +175,7 @@ struct crypto_alg p8_aes_ctr_alg = {
>  	.cra_init = p8_aes_ctr_init,
>  	.cra_exit = p8_aes_ctr_exit,
>  	.cra_blkcipher = {
> -			  .ivsize = 0,
> +			  .ivsize = AES_BLOCK_SIZE,
>  			  .min_keysize = AES_MIN_KEY_SIZE,
>  			  .max_keysize = AES_MAX_KEY_SIZE,
>  			  .setkey = p8_aes_ctr_setkey,
> -- 
> 1.9.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Looks ok.
Kamal Mostafa June 28, 2016, 3:34 p.m. UTC | #4

diff mbox

Patch

diff --git a/drivers/crypto/vmx/aes_cbc.c b/drivers/crypto/vmx/aes_cbc.c
index f3801b9..3f8bb9a 100644
--- a/drivers/crypto/vmx/aes_cbc.c
+++ b/drivers/crypto/vmx/aes_cbc.c
@@ -191,7 +191,7 @@  struct crypto_alg p8_aes_cbc_alg = {
 	.cra_init = p8_aes_cbc_init,
 	.cra_exit = p8_aes_cbc_exit,
 	.cra_blkcipher = {
-			  .ivsize = 0,
+			  .ivsize = AES_BLOCK_SIZE,
 			  .min_keysize = AES_MIN_KEY_SIZE,
 			  .max_keysize = AES_MAX_KEY_SIZE,
 			  .setkey = p8_aes_cbc_setkey,
diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c
index 404a1b6..72f1389 100644
--- a/drivers/crypto/vmx/aes_ctr.c
+++ b/drivers/crypto/vmx/aes_ctr.c
@@ -175,7 +175,7 @@  struct crypto_alg p8_aes_ctr_alg = {
 	.cra_init = p8_aes_ctr_init,
 	.cra_exit = p8_aes_ctr_exit,
 	.cra_blkcipher = {
-			  .ivsize = 0,
+			  .ivsize = AES_BLOCK_SIZE,
 			  .min_keysize = AES_MIN_KEY_SIZE,
 			  .max_keysize = AES_MAX_KEY_SIZE,
 			  .setkey = p8_aes_ctr_setkey,