diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2013-01-25 09:54:20 -0500 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2013-01-31 23:59:33 -0500 |
commit | 7810cc1e7721220f1ed2a23ca95113d6434f6dcd (patch) | |
tree | 4642aac5aae21cc87917875b150ef516cc666868 /lib/digsig.c | |
parent | 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff) |
digsig: Fix memory leakage in digsig_verify_rsa()
digsig_verify_rsa() does not free kmalloc'ed buffer returned by
mpi_get_buffer().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'lib/digsig.c')
-rw-r--r-- | lib/digsig.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/digsig.c b/lib/digsig.c index 8c0e62975c88..dc2be7ed1765 100644 --- a/lib/digsig.c +++ b/lib/digsig.c | |||
@@ -162,6 +162,8 @@ static int digsig_verify_rsa(struct key *key, | |||
162 | memset(out1, 0, head); | 162 | memset(out1, 0, head); |
163 | memcpy(out1 + head, p, l); | 163 | memcpy(out1 + head, p, l); |
164 | 164 | ||
165 | kfree(p); | ||
166 | |||
165 | err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); | 167 | err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len); |
166 | if (err) | 168 | if (err) |
167 | goto err; | 169 | goto err; |