From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753941AbcAXVx5 (ORCPT ); Sun, 24 Jan 2016 16:53:57 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34668 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbcAXVxx (ORCPT ); Sun, 24 Jan 2016 16:53:53 -0500 Message-ID: <1453672430.1223.456.camel@edumazet-glaptop2.roam.corp.google.com> Subject: [PATCH net] af_unix: fix struct pid memory leak From: Eric Dumazet To: Willy Tarreau Cc: Eric Dumazet , Dmitry Vyukov , netdev , Rainer Weikusat , Michal Hocko , Andrew Morton , "Paul E. McKenney" , Vladimir Davydov , Johannes Weiner , LKML , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin Date: Sun, 24 Jan 2016 13:53:50 -0800 In-Reply-To: <20160124030412.GA13949@1wt.eu> References: <1453481401.1223.396.camel@edumazet-glaptop2.roam.corp.google.com> <20160123180010.GB1609@1wt.eu> <20160123184007.GE1609@1wt.eu> <20160124021145.GA12367@1wt.eu> <20160124023824.GA13942@1wt.eu> <20160124030412.GA13949@1wt.eu> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet 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 --- 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; }