From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934078AbcBBUjp (ORCPT ); Tue, 2 Feb 2016 15:39:45 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:50765 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754952AbcBBUjo (ORCPT ); Tue, 2 Feb 2016 15:39:44 -0500 Date: Tue, 2 Feb 2016 21:39:29 +0100 From: Willy Tarreau To: Hannes Frederic Sowa Cc: Linus Torvalds , David Herrmann , "David S. Miller" , netdev , linux-kernel , Eric Dumazet , ???????? ?????????????????? , Tetsuo Handa , Simon McVittie Subject: Re: [PATCH v2] unix: properly account for FDs passed over unix sockets Message-ID: <20160202203929.GC25828@1wt.eu> References: <201601100657.u0A6vk1B025554@mail.home.local> <56B0F574.5080105@stressinduktion.org> <56B11278.8000805@stressinduktion.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B11278.8000805@stressinduktion.org> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 02, 2016 at 09:32:56PM +0100, Hannes Frederic Sowa wrote: > But "struct pid *" in unix_skb_parms should be enough to get us to > corresponding "struct cred *" so we can decrement the correct counter > during skb destruction. > > So: > > We increment current task's unix_inflight and also check the current > task's limit during attaching fds to skbs and decrement the inflight > counter via "struct pid *". This looks like it should work. I like it as well, the principle sounds sane. > >That way it's always the person who actually does the send (rather > >than the opener of the socket _or_ the opener of the file that gets > >passed around) that gets credited, and thanks to the cred pointer we > >can then de-credit them properly. > > Exactly, I try to implement that. Thanks a lot! Thanks to you Hannes, I appreciate that you work on it, it would take much more time to me to dig into this. Willy