summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch')
-rw-r--r--recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch53
1 files changed, 0 insertions, 53 deletions
diff --git a/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch b/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch
deleted file mode 100644
index 995fbed..0000000
--- a/recipes-kernel/cryptodev/cryptodev-fsl/0008-fix-cipher-algorithm-memleaks.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From 9675e358fe73b33029a470aa5cf47527848f4054 Mon Sep 17 00:00:00 2001
2From: Cristian Stoica <cristian.stoica@freescale.com>
3Date: Tue, 26 Nov 2013 16:36:37 +0200
4Subject: [[Patch][fsl 08/16] fix cipher algorithm memleaks
5
6Upstream-status: Pending
7
8Patch 67e743aef130d107c1b41e0aace7677f9ff53bd1 allocates memory for
9cipher algorithm key without freeing it when session terminates. This
10patch addresses the deallocation issue.
11
12Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
13Tested-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
19diff --git a/cryptodev_int.h b/cryptodev_int.h
20index 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 */
31diff --git a/ioctl.c b/ioctl.c
32index 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--
521.7.9.7
53