From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [RFC][PATCH] netlink: Only check file credentials for implicit destinations Date: Sun, 25 May 2014 17:32:55 -0700 Message-ID: References: <87d2g7d9ag.fsf_-_@x220.int.ebiederm.org> <536AB151.2070804@dti2.net> <20140507.185256.496391962242529591.davem@davemloft.net> <20140522170505.64ef87a2@griffin> <87ioow6pt6.fsf@x220.int.ebiederm.org> <87zji6v2mk.fsf_-_@x220.int.ebiederm.org> <874n0ds9sk.fsf@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Andy Lutomirski , "Jorge Boncompte [DTI2]" , Jiri Benc , David Miller , Vivek Goyal , Simo Sorce , "security@kernel.org" , Network Development , "Serge E. Hallyn" , Michael Kerrisk-manpages To: "Eric W. Biederman" Return-path: Received: from mail-ve0-f175.google.com ([209.85.128.175]:51410 "EHLO mail-ve0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbaEZAc4 (ORCPT ); Sun, 25 May 2014 20:32:56 -0400 Received: by mail-ve0-f175.google.com with SMTP id jw12so8566261veb.34 for ; Sun, 25 May 2014 17:32:55 -0700 (PDT) In-Reply-To: <874n0ds9sk.fsf@x220.int.ebiederm.org> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, May 25, 2014 at 4:44 PM, Eric W. Biederman wrote: > > But I agree that since connect on sockets is really the equivalent of > open on files, and unprivileged users can change where a socket is > connected to, using a struct cred captured at connect() time is better > than the struct cred captured at socket() time. Ack. Conceptually, "connect/listen" really ends up being the equivalent to pathname lookup, not so much "socket()", which just mostly creates the placeholder for future work. That would also be very much consistent with making "sendto" look at current creds rather than cached creds (but only _if_ it has an address, of course - using "sendto(... , NULL, 0)" should _not_ somehow be different from "send()"). So I think that from a sensibility and "please explain the semantics to me" standpoint, that would be sane semantics. Linus