Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbaDPBGK (ORCPT ); Tue, 15 Apr 2014 21:06:10 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:41854 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbaDPBGH (ORCPT ); Tue, 15 Apr 2014 21:06:07 -0400 Date: Tue, 15 Apr 2014 21:05:56 -0400 (EDT) Message-Id: <20140415.210556.1908241932784812364.davem@davemloft.net> To: vgoyal@redhat.com Cc: luto@amacapital.net, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, netdev@vger.kernel.org, tj@kernel.org, ssorce@redhat.com, lpoetter@redhat.com, kay@redhat.com, dwalsh@redhat.com Subject: Re: [PATCH 2/2] net: Implement SO_PASSCGROUP to enable passing cgroup path From: David Miller In-Reply-To: <20140416002010.GA5035@redhat.com> References: <1397596546-10153-3-git-send-email-vgoyal@redhat.com> <20140416002010.GA5035@redhat.com> X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.7 (shards.monkeyblade.net [149.20.54.216]); Tue, 15 Apr 2014 18:06:01 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivek Goyal Date: Tue, 15 Apr 2014 20:20:10 -0400 > On Tue, Apr 15, 2014 at 02:53:13PM -0700, Andy Lutomirski wrote: >> On Tue, Apr 15, 2014 at 2:15 PM, Vivek Goyal wrote: >> > This patch implements socket option SO_PASSCGROUP along the lines of >> > SO_PASSCRED. >> > >> > If SO_PASSCGROUP is set, then recvmsg() will get a control message >> > SCM_CGROUP which will contain the cgroup path of sender. This cgroup >> > belongs to first mounted hierarchy in the sytem. >> > >> > SCM_CGROUP control message can only be received and sender can not send >> > a SCM_CGROUP message. Kernel automatically generates one if receiver >> > chooses to receive one. >> > >> > This works both for unix stream and datagram sockets. >> > >> > cgroup information is passed only if either the sender or receiver has >> > SO_PASSCGROUP option set. This means for existing workloads they should >> > not see any significant performance impact of this change. >> >> This is odd. Shouldn't an SCM_CGROUP cmsg be generated when the >> receiver has SO_PASSCGROUP set and the sender passes SCM_CGROUP to >> sendmsg? > > How can receiver trust the cgroup info generated by sender. It needs to > be generated by kernel so that receiver can trust it. > > And if receiver needs to know cgroup of sender, receiver can just set > SO_PASSCGROUP on socket and receiver should get one SCM_CGROUP message > with each message received. I completely agree. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/