Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:28797 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755936AbcCBUYi (ORCPT ); Wed, 2 Mar 2016 15:24:38 -0500 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: Eric Dumazet , Rainer Weikusat , "David S. Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] af_unix: fix struct pid memory leak Date: Wed, 2 Mar 2016 15:23:48 -0500 Message-Id: <1456950258-513-4-git-send-email-sasha.levin@oracle.com> In-Reply-To: <1456950258-513-1-git-send-email-sasha.levin@oracle.com> References: <1456950258-513-1-git-send-email-sasha.levin@oracle.com> Sender: stable-owner@vger.kernel.org List-ID: From: Eric Dumazet This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =============== [ Upstream commit fa0dc04df259ba2df3ce1920e9690c7842f8fa4b ] 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 Signed-off-by: Eric Dumazet Cc: Rainer Weikusat Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 cb3a01a..c741d83 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2131,6 +2131,7 @@ again: if (signal_pending(current)) { err = sock_intr_errno(timeo); + scm_destroy(&scm); goto out; } -- 2.5.0