From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934171AbcBBUo5 (ORCPT ); Tue, 2 Feb 2016 15:44:57 -0500 Received: from mail-ig0-f194.google.com ([209.85.213.194]:35554 "EHLO mail-ig0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932865AbcBBUoy (ORCPT ); Tue, 2 Feb 2016 15:44:54 -0500 MIME-Version: 1.0 In-Reply-To: <56B11278.8000805@stressinduktion.org> References: <201601100657.u0A6vk1B025554@mail.home.local> <56B0F574.5080105@stressinduktion.org> <56B11278.8000805@stressinduktion.org> Date: Tue, 2 Feb 2016 12:44:54 -0800 X-Google-Sender-Auth: fc4kt_bwlgstBVYTSwcJATWPa-Q Message-ID: Subject: Re: [PATCH v2] unix: properly account for FDs passed over unix sockets From: Linus Torvalds To: Hannes Frederic Sowa Cc: David Herrmann , Willy Tarreau , "David S. Miller" , netdev , linux-kernel , Eric Dumazet , =?UTF-8?B?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?= , Tetsuo Handa , Simon McVittie Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 2, 2016 at 12:32 PM, Hannes Frederic Sowa wrote: > > Unfortunately we never transfer a scm_cookie via the skbs but merely use it > to initialize unix_skb_parms structure in skb->cb and destroy it afterwards. Ok, I obviously didn't check very closely. > 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. Umm. I think the "struct cred" may change in between, can't it? So I don't think you can later look up the cred based on the pid. Could we add the cred pointer (or just the user pointer) to the unix_skb_parms? Or maybe just add it to the "struct scm_fp_list"? Linus