diff options
author | Cristian Stoica <cristian.stoica@nxp.com> | 2016-01-25 11:19:43 +0200 |
---|---|---|
committer | Zhenhua Luo <zhenhua.luo@nxp.com> | 2016-06-23 10:58:51 +0800 |
commit | 41d1478e1294d06f0cce58fe847c0b0f1706b808 (patch) | |
tree | 8c6c5e2887cc30435ee40e764bb2ede58278d0ac /recipes-kernel/cryptodev/sdk_patches/0039-fix-memory-leaks-on-error-path-for-CIOCHASH.patch | |
parent | e3956ffbc217e468e26c9ce2e8932d3720fabca4 (diff) | |
download | meta-fsl-ppc-41d1478e1294d06f0cce58fe847c0b0f1706b808.tar.gz |
cryptodev-qoriq: upgrade to 1.8 plus fsl patches
upstream commit: 87b56e04b24c6d4be145483477eff7d3153290e9
Also:
- move all fsl patches on top of cryptodev-1.8
- add CIOCHASH ioctl
- fix incorrect tests initializations
- modify yocto patches to match updated Makefiles
Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0039-fix-memory-leaks-on-error-path-for-CIOCHASH.patch')
-rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0039-fix-memory-leaks-on-error-path-for-CIOCHASH.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0039-fix-memory-leaks-on-error-path-for-CIOCHASH.patch b/recipes-kernel/cryptodev/sdk_patches/0039-fix-memory-leaks-on-error-path-for-CIOCHASH.patch new file mode 100644 index 0000000..fc2f4c8 --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0039-fix-memory-leaks-on-error-path-for-CIOCHASH.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From 3e3996b40fd3a93cbe2e5ddee244280dd7de6c18 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cristian Stoica <cristian.stoica@freescale.com> | ||
3 | Date: Tue, 9 Feb 2016 21:07:06 +0200 | ||
4 | Subject: [PATCH 39/40] fix memory leaks on error path for CIOCHASH | ||
5 | |||
6 | Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> | ||
7 | --- | ||
8 | ioctl.c | 20 +++++++++++--------- | ||
9 | 1 file changed, 11 insertions(+), 9 deletions(-) | ||
10 | |||
11 | diff --git a/ioctl.c b/ioctl.c | ||
12 | index ff3de44..8d81b56 100644 | ||
13 | --- a/ioctl.c | ||
14 | +++ b/ioctl.c | ||
15 | @@ -1190,18 +1190,17 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_) | ||
16 | ret = hash_run(&khop); | ||
17 | if (unlikely(ret)) { | ||
18 | dwarning(1, "Error in hash run"); | ||
19 | - return ret; | ||
20 | + goto hash_err; | ||
21 | } | ||
22 | |||
23 | ret = copy_to_user(khop.hash_op.mac_result, khop.hash_output, khop.digestsize); | ||
24 | if (unlikely(ret)) { | ||
25 | dwarning(1, "Error in copy to user"); | ||
26 | - return ret; | ||
27 | } | ||
28 | |||
29 | - /* put session */ | ||
30 | + hash_err: | ||
31 | hash_destroy_session(khop.hash_op.ses); | ||
32 | - return 0; | ||
33 | + return ret; | ||
34 | case CIOCAUTHCRYPT: | ||
35 | if (unlikely(ret = kcaop_from_user(&kcaop, fcr, arg))) { | ||
36 | dwarning(1, "Error copying from user"); | ||
37 | @@ -1532,22 +1531,25 @@ cryptodev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg_) | ||
38 | ret = hash_run(&khop); | ||
39 | if (unlikely(ret)) { | ||
40 | dwarning(1, "Error in hash run"); | ||
41 | - return ret; | ||
42 | + goto hash_err; | ||
43 | } | ||
44 | |||
45 | ret = copy_to_user(khop.hash_op.mac_result, khop.hash_output, | ||
46 | khop.digestsize); | ||
47 | if (unlikely(ret)) { | ||
48 | dwarning(1, "Error in copy to user"); | ||
49 | - return ret; | ||
50 | + goto hash_err; | ||
51 | } | ||
52 | |||
53 | - copy_to_user(arg, &compat_hash_op_data, | ||
54 | + ret = copy_to_user(arg, &compat_hash_op_data, | ||
55 | sizeof(struct compat_hash_op_data)); | ||
56 | + if (unlikely(ret)) { | ||
57 | + dwarning(1, "Error in copy to user"); | ||
58 | + } | ||
59 | |||
60 | - /* put session */ | ||
61 | + hash_err: | ||
62 | hash_destroy_session(khop.hash_op.ses); | ||
63 | - return 0; | ||
64 | + return ret; | ||
65 | |||
66 | case COMPAT_CIOCAUTHCRYPT: | ||
67 | if (unlikely(ret = compat_kcaop_from_user(&kcaop, fcr, arg))) { | ||
68 | -- | ||
69 | 2.7.0 | ||
70 | |||