aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-01-24 13:53:50 -0800
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:32:08 +0200
commit6d4717c01face6564c99ec65de983c3ae2aa234c (patch)
treef207104c56219bde44705c1fcbf6fd7654ada0fc /net
parent9a5991e31ce62795e7c606eb3942b6a0ff3d2fa4 (diff)
af_unix: fix struct pid memory leak
Dmitry reported a struct pid leak detected by a syzkaller program. Bug happens in unix_stream_recvmsg() when we break the loop when a signal is pending, without properly releasing scm. Fixes: b3ca9b02b007 ("net: fix multithreaded signal handling in unix recv routines") Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Rainer Weikusat <rweikusat@mobileactivedefense.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/unix/af_unix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index e7891254a..b72855cae 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2270,6 +2270,7 @@ again:
if (signal_pending(current)) {
err = sock_intr_errno(timeo);
+ scm_destroy(siocb->scm);
goto out;
}