From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754991AbcBCA5S (ORCPT ); Tue, 2 Feb 2016 19:57:18 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54882 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753954AbcBCA5R (ORCPT ); Tue, 2 Feb 2016 19:57:17 -0500 X-Sasl-enc: 7Zvh+V8lNroxI8VTjgFuI2sGmAAjAaydpjy4Dmap2M/Q 1454461035 Subject: Re: [PATCH v2] unix: properly account for FDs passed over unix sockets To: Linus Torvalds References: <201601100657.u0A6vk1B025554@mail.home.local> <56B0F574.5080105@stressinduktion.org> <56B11278.8000805@stressinduktion.org> <20160202203929.GC25828@1wt.eu> <56B125B7.6020702@stressinduktion.org> Cc: Network Development , Tetsuo Handa , Simon McVittie , Willy Tarreau , Eric Dumazet , linux-kernel , "David S. Miller" , ???????? ?????????????????? , David Herrmann From: Hannes Frederic Sowa Message-ID: <56B15067.6000407@stressinduktion.org> Date: Wed, 3 Feb 2016 01:57:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.02.2016 23:11, Linus Torvalds wrote: > [ sorry for the html mail, I'm out grocery shopping ] > > On Feb 2, 2016 13:55, "Hannes Frederic Sowa" > wrote: >> >> I slightly tested the attached patch. > > Looks fine. I do wonder: if the only thing we use that "struct cred" for is > to do that ->user lookup, maybe we should just use "struct user_struct" > directly, and skip the cred entirely. > > Something like > > fp->user = get_uid(current_user()); > > and then > > put_uid(fp->user); > > But I'm OK with that patch as is if you prefer it that way (maybe you want > to use the cred to then test for root separately etc, out maybe there > already was done use of cred as cred that I just missed when reading the > patch on my phone..) I don't see any reason to switch over to struct user_struct. I tested a patch and will send it out soon. Bye, Hannes