From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933586AbcI0OQl (ORCPT ); Tue, 27 Sep 2016 10:16:41 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35206 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622AbcI0OQb (ORCPT ); Tue, 27 Sep 2016 10:16:31 -0400 Subject: Re: kernel BUG at net/unix/garbage.c:149!" References: <57BDAE06.1040400@kyup.com> <9dde3145-9128-ffef-1b84-e3bd429dd4e8@stressinduktion.org> Cc: Miklos Szeredi , Hannes Frederic Sowa , "Linux-Kernel@Vger. Kernel. Org" , netdev@vger.kernel.org To: David Miller From: Nikolay Borisov Message-ID: <57EA7F3B.3030801@kyup.com> Date: Tue, 27 Sep 2016 17:16:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Added Dave Miller to see what's the status of this patch] On 08/30/2016 12:18 PM, Miklos Szeredi wrote: > On Tue, Aug 30, 2016 at 12:37 AM, Miklos Szeredi wrote: >> On Sat, Aug 27, 2016 at 11:55 AM, Miklos Szeredi wrote: > >> crash> list -H gc_inflight_list unix_sock.link -s unix_sock.inflight | >> grep counter | cut -d= -f2 | awk '{s+=$1} END {print s}' >> 130 >> crash> p unix_tot_inflight >> unix_tot_inflight = $2 = 135 >> >> We've lost track of a total of five inflight sockets, so it's not a >> one-off thing. Really weird... Now off to sleep, maybe I'll dream of >> the solution. > > Okay, found one bug: gc assumes that in-flight sockets that don't have > an external ref can't gain one while unix_gc_lock is held. That is > true because unix_notinflight() will be called before detaching fds, > which takes unix_gc_lock. Only MSG_PEEK was somehow overlooked. That > one also clones the fds, also keeping them in the skb. But through > MSG_PEEK an external reference can definitely be gained without ever > touching unix_gc_lock. > > Not sure whether the reported bug can be explained by this. Can you > confirm the MSG_PEEK was used in the setup? > > Does someone want to write a stress test for SCM_RIGHTS + MSG_PEEK? > > Anyway, attaching a fix that works by acquiring unix_gc_lock in case > of MSG_PEEK also. It is trivially correct, but I haven't tested it. > > Thanks, > Miklos > Dave, What's the status of https://patchwork.ozlabs.org/patch/664062/ , is this going to be picked up ? Regards, Nikolay