Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315986

[PATCH net] af_unix: fix struct pid memory leak

From Eric Dumazet <eric.dumazet@gmail.com>
Newsgroups linux.kernel
Subject [PATCH net] af_unix: fix struct pid memory leak
Date 2016-01-24 23:00 +0100
Message-ID <qUARs-2qu-7@gated-at.bofh.it> (permalink)
References (5 earlier) <qUbq1-6PU-5@gated-at.bofh.it> <qUirw-6kO-7@gated-at.bofh.it> <qUiKR-6tf-3@gated-at.bofh.it> <qUj4d-6Ac-3@gated-at.bofh.it> <qUjdU-6VH-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Eric Dumazet <edumazet@google.com>

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>
---
 net/unix/af_unix.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c5bf5ef2bf89..49d5093eb055 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2339,6 +2339,7 @@ again:
 
 			if (signal_pending(current)) {
 				err = sock_intr_errno(timeo);
+				scm_destroy(&scm);
 				goto out;
 			}
 

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

struct pid memory leak Dmitry Vyukov <dvyukov@google.com> - 2016-01-22 16:10 +0100
  Re: struct pid memory leak Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-22 18:00 +0100
    Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-23 19:10 +0100
      Re: struct pid memory leak Dmitry Vyukov <dvyukov@google.com> - 2016-01-23 19:50 +0100
        Re: struct pid memory leak Eric Dumazet <edumazet@google.com> - 2016-01-23 21:00 +0100
        Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-24 03:20 +0100
          Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-24 03:40 +0100
            Re: struct pid memory leak Eric Dumazet <edumazet@google.com> - 2016-01-24 04:00 +0100
              Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-24 04:10 +0100
                Re: struct pid memory leak Eric Dumazet <edumazet@google.com> - 2016-01-24 22:20 +0100
                [PATCH net] af_unix: fix struct pid memory leak Eric Dumazet <eric.dumazet@gmail.com> - 2016-01-24 23:00 +0100
                Re: [PATCH net] af_unix: fix struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-25 02:10 +0100
      Re: struct pid memory leak Willy Tarreau <w@1wt.eu> - 2016-01-23 19:50 +0100

csiph-web