Skip to content

Commit 7790ff4

Browse files
committed
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
2 parents 60d509f + 72a763d commit 7790ff4

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

crypto/algif_hash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ static int hash_recvmsg(struct kiocb *unused, struct socket *sock,
161161
else if (len < ds)
162162
msg->msg_flags |= MSG_TRUNC;
163163

164+
msg->msg_namelen = 0;
165+
164166
lock_sock(sk);
165167
if (ctx->more) {
166168
ctx->more = 0;

crypto/algif_skcipher.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,
432432
long copied = 0;
433433

434434
lock_sock(sk);
435+
msg->msg_namelen = 0;
435436
for (iov = msg->msg_iov, iovlen = msg->msg_iovlen; iovlen > 0;
436437
iovlen--, iov++) {
437438
unsigned long seglen = iov->iov_len;

0 commit comments

Comments
 (0)