diff options
Diffstat (limited to 'meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch')
| -rw-r--r-- | meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch b/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch deleted file mode 100644 index 995fbed4e..000000000 --- a/meta-fsl-ppc/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | From 9675e358fe73b33029a470aa5cf47527848f4054 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Cristian Stoica <cristian.stoica@freescale.com> | ||
| 3 | Date: Tue, 26 Nov 2013 16:36:37 +0200 | ||
| 4 | Subject: [[Patch][fsl 08/16] fix cipher algorithm memleaks | ||
| 5 | |||
| 6 | Upstream-status: Pending | ||
| 7 | |||
| 8 | Patch 67e743aef130d107c1b41e0aace7677f9ff53bd1 allocates memory for | ||
| 9 | cipher algorithm key without freeing it when session terminates. This | ||
| 10 | patch addresses the deallocation issue. | ||
| 11 | |||
| 12 | Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
| 13 | Tested-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> | ||
| 14 | --- | ||
| 15 | cryptodev_int.h | 1 + | ||
| 16 | ioctl.c | 2 ++ | ||
| 17 | 2 files changed, 3 insertions(+) | ||
| 18 | |||
| 19 | diff --git a/cryptodev_int.h b/cryptodev_int.h | ||
| 20 | index 8d206c9..8891837 100644 | ||
| 21 | --- a/cryptodev_int.h | ||
| 22 | +++ b/cryptodev_int.h | ||
| 23 | @@ -166,6 +166,7 @@ struct csession { | ||
| 24 | struct hash_data hdata; | ||
| 25 | uint32_t sid; | ||
| 26 | uint32_t alignmask; | ||
| 27 | + uint8_t *key; | ||
| 28 | |||
| 29 | unsigned int array_size; | ||
| 30 | unsigned int used_pages; /* the number of pages that are used */ | ||
| 31 | diff --git a/ioctl.c b/ioctl.c | ||
| 32 | index 18874d3..63467e0 100644 | ||
| 33 | --- a/ioctl.c | ||
| 34 | +++ b/ioctl.c | ||
| 35 | @@ -235,6 +235,7 @@ crypto_create_session(struct fcrypt *fcr, struct session_op *sop) | ||
| 36 | goto error_cipher; | ||
| 37 | |||
| 38 | key = kmalloc(keylen, GFP_KERNEL); | ||
| 39 | + ses_new->key = key; | ||
| 40 | if (unlikely(!key)) { | ||
| 41 | ret = -ENOMEM; | ||
| 42 | goto error_cipher; | ||
| 43 | @@ -342,6 +343,7 @@ crypto_destroy_session(struct csession *ses_ptr) | ||
| 44 | ddebug(2, "freeing space for %d user pages", ses_ptr->array_size); | ||
| 45 | kfree(ses_ptr->pages); | ||
| 46 | kfree(ses_ptr->sg); | ||
| 47 | + kfree(ses_ptr->key); | ||
| 48 | mutex_unlock(&ses_ptr->sem); | ||
| 49 | mutex_destroy(&ses_ptr->sem); | ||
| 50 | kfree(ses_ptr); | ||
| 51 | -- | ||
| 52 | 1.7.9.7 | ||
| 53 | |||
