Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:63267 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751746AbdEWPaX (ORCPT ); Tue, 23 May 2017 11:30:23 -0400 From: David Howells In-Reply-To: <1495551292.2742620.985957224.3FCF254A@webmail.messagingengine.com> References: <1495551292.2742620.985957224.3FCF254A@webmail.messagingengine.com> <149547014649.10599.12025037906646164347.stgit@warthog.procyon.org.uk> <87lgpoww67.fsf@xmission.com> <1495491733.25946.3.camel@redhat.com> <874lwbraxh.fsf@xmission.com> To: Colin Walters Cc: dhowells@redhat.com, Djalal Harouni , "Eric W. Biederman" , Jeff Layton , trondmy@primarydata.com, Miklos Szeredi , linux-nfs@vger.kernel.org, "linux-kernel" , Alexander Viro , Linux FS Devel , "open list:CONTROL GROUP (CGROUP)" Subject: Re: [RFC][PATCH 0/9] Make containers kernel objects MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 23 May 2017 16:30:19 +0100 Message-ID: <3118.1495553419@warthog.procyon.org.uk> Sender: linux-nfs-owner@vger.kernel.org List-ID: Colin Walters wrote: > Why not drop the upcall model in favor of having userspace monitor events > via a (more efficient) protocol and react to them on its own? (1) That's not necessarily more efficient. You now have the overhead of a permanently running userspace daemon in every relevant namespace combination. (2) You then have to work out how to route to the appropriate daemon. > It's just generally more flexible Actually, it's less flexible. You can't easily get at the caller's namespaces. > and avoids all of those issues like replicating the seccomp configuration, > etc. So does my container implementation. > Something like inotify/signalfd could be a precedent around having a read()/poll()able > fd. /proc/keys-requests ? > > Then if you create a new user namespace, and open /proc/keys-requests, the > kernel will always write to that instead of calling /sbin/request-key. That's not good enough. You're basically making it one daemon per user namespace and ignoring all the other namespaces. [Also note that the kernel would have to paste a temporary authorisation key into the daemon's session keyring for each key that requires instantiation]. David