From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: Keyrings, user namespaces and the user_struct Date: Thu, 27 Oct 2016 17:11:11 +0100 Message-ID: <1496.1477584671@warthog.procyon.org.uk> References: <3677.1477506925@warthog.procyon.org.uk> <87mvhrrng3.fsf@xmission.com> <20161026143856.GL3334@pc.thejh.net> <17576.1477412418@warthog.procyon.org.uk> <18335.1477414412@warthog.procyon.org.uk> <1477414605.3079.40.camel@HansenPartnership.com> <20161025170602.GB24481@laptop.thejh.net> <1477418708.3079.52.camel@HansenPartnership.com> <20161025181735.GC24481@laptop.thejh.net> <9243.1477492490@warthog.procyon.org.uk> <9610.1477493338@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <3677.1477506925-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org> Content-ID: <1495.1477584671.1-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Cc: James Bottomley , Linux Containers , Oleg Nesterov , Eric Paris , Andy Lutomirski , dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, LSM List , keyrings-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Eric W. Biederman" , simo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org List-Id: containers.vger.kernel.org David Howells wrote: > > Plus there are various really weird things in their where the keyring > > names of _tid, _pid, _ses, get reused over and over again. > > True, however per-thread (_tid) and per-process(_pid) keyrings are always > allocated by key_alloc() and never looked up by name when being created. > > Anonymous session (_ses) keyrings are also created by key_alloc() and not > looked up when created. It's only when a named session keyring is requested > that a look up by name is done. > > I could make the per-thread, per-process and anon-session keyrings nameless by > default, or prefix them with '.' and not permit joining of a keyring whose > name begins with a '.' (you aren't allowed to use add_key() to create a such > keyrings, so that really ought to be extended to here too). Note that the per-thread, per-process and anon-session keyrings are not joinable by default as they don't come with SEARCH permission for u/g/o. David