From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: memory leak in do_ipv6_setsockopt Date: Tue, 01 Dec 2015 15:24:13 +0100 Message-ID: <565DAD8D.9020800@iogearbox.net> References: <1448977016.25582.18.camel@edumazet-glaptop2.roam.corp.google.com> <565DA9BE.3060006@iogearbox.net> <1448979404.25582.23.camel@edumazet-glaptop2.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Dmitry Vyukov , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , Vlad Yasevich , Neil Horman , linux-sctp@vger.kernel.org, syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin , Eric Dumazet To: Eric Dumazet Return-path: In-Reply-To: <1448979404.25582.23.camel@edumazet-glaptop2.roam.corp.google.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 12/01/2015 03:16 PM, Eric Dumazet wrote: > On Tue, 2015-12-01 at 15:07 +0100, Daniel Borkmann wrote: > >> Yeah, we miss inet6_destroy_sock() in SCTP. :-( >> >> Looks good to me. > > OK, I will send a formal (and tested ;) ) patch. I was shortly wondering whether there could be a use-after-free by doing this after sctp_destroy_sock() due to the sctp_endpoint_destroy() that would eventually drop a ref on the socket, but the endpoint holds a separate ref, so we should be good. Thanks, Daniel