summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-22 07:07:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-22 07:07:46 -0700
commit7790ff45be89b6a3ed98bb8c0572255ad4ed7a28 (patch)
treebf3edc17fb419c9cc326d3d72da6cf8b729ef1ab /crypto
parent60d509fa6a9c4653a86ad830e4c4b30360b23f0e (diff)
parent72a763d805a48ac8c0bf48fdb510e84c12de51fe (diff)
downloadop-kernel-dev-7790ff45be89b6a3ed98bb8c0572255ad4ed7a28.zip
op-kernel-dev-7790ff45be89b6a3ed98bb8c0572255ad4ed7a28.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "This fixes a kernel memory leak in the algif interface" * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: algif - suppress sending source address information in recvmsg
Diffstat (limited to 'crypto')
-rw-r--r--crypto/algif_hash.c2
-rw-r--r--crypto/algif_skcipher.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index ef5356c..0262210 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -161,6 +161,8 @@ static int hash_recvmsg(struct kiocb *unused, struct socket *sock,
else if (len < ds)
msg->msg_flags |= MSG_TRUNC;
+ msg->msg_namelen = 0;
+
lock_sock(sk);
if (ctx->more) {
ctx->more = 0;
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 6a6dfc0..a1c4f0a 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -432,6 +432,7 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,
long copied = 0;
lock_sock(sk);
+ msg->msg_namelen = 0;
for (iov = msg->msg_iov, iovlen = msg->msg_iovlen; iovlen > 0;
iovlen--, iov++) {
unsigned long seglen = iov->iov_len;
OpenPOWER on IntegriCloud