3/10

----------------------------

commit 15931cdf7989183db732cd1823626515d42841e7

Author: Jaren Johnston <jaren's email>

Date:   Fri Jun 8 15:48:54 2012 -0700

 

    null ptr check & resource release fix

    

    Change-Id: I60aad86df09d98d09e37c5e56e13e15eceaed872

 

diff --git a/authenc.c b/authenc.c

index ddfaaee..698febd 100644

--- a/authenc.c

+++ b/authenc.c

@@ -633,7 +633,7 @@ __crypto_auth_run_zc(struct csession *ses_ptr, struct
kernel_crypt_auth_op *kcao

                                               return -ENOMEM;

                               }

-                              if (caop->auth_len > 0) {

+                              if (caop->auth_src && caop->auth_len > 0) {

                                               if
(unlikely(copy_from_user(auth_buf, caop->auth_src, caop->auth_len))) {

                                                               dprintk(1,
KERN_ERR, "unable to copy auth data from userspace.\n");

                                                               ret =
-EFAULT;

@@ -663,7 +663,8 @@ __crypto_auth_run_zc(struct csession *ses_ptr, struct
kernel_crypt_auth_op *kcao

 
ses_ptr->cdata.aead == 0)) 

                                                {

                                                               dprintk(0,
KERN_ERR, "Only stream and AEAD ciphers are allowed for authenc\n");

-                                                              return
-EINVAL;

+                                                              ret =
-EINVAL;

+                                                              goto fail;

                                               }

                                                if (caop->op == COP_ENCRYPT)
dst_len = caop->len + cryptodev_cipher_get_tag_size(&ses_ptr->cdata);

 

_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to