From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898AbbDGAyj (ORCPT ); Mon, 6 Apr 2015 20:54:39 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:49593 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752753AbbDGAyg (ORCPT ); Mon, 6 Apr 2015 20:54:36 -0400 X-Sasl-enc: 9Co9dJPICYtHfPVN+jfKBFiHwb++heRvt/BvCt6fU/Ot 1428368075 Message-ID: <1428368070.2705.12.camel@pluto.fritz.box> Subject: Re: [RFC PATCH 5 7/7] KEYS: exec request key within service thread of key creator From: Ian Kent To: David Howells Cc: Kernel Mailing List , Oleg Nesterov , Trond Myklebust , "J. Bruce Fields" , Benjamin Coddington , Al Viro , Jeff Layton , "Eric W. Biederman" Date: Tue, 07 Apr 2015 08:54:30 +0800 In-Reply-To: <18931.1427979484@warthog.procyon.org.uk> References: <20150331031533.10464.1615.stgit@pluto.fritz.box> <20150331030340.10464.30272.stgit@pluto.fritz.box> <18931.1427979484@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-04-02 at 13:58 +0100, David Howells wrote: > Ian Kent wrote: > > > + > > + /* Namespace token */ > > + int umh_token; > > If you could put it after data_len so that all the smaller-than-wordsize > fields are together for better packing. OK. > > > + umh_wq_put_token(key->umh_token); > > Does gc.c need an extra #include for this? Umm ... you'd think so, wonder how it compiled without kmod.h .... > > > + /* If running within a container use the container namespace */ > > + if (current->nsproxy->net_ns != &init_net) > > + key->umh_token = umh_wq_get_token(0, "keys"); > > So keys live in the networking namespace? Perhaps checking the pid namespace would make more sense? > > > - ret = call_usermodehelper_keys(argv[0], argv, envp, keyring, > > - UMH_WAIT_PROC); > > + /* If running within a container use the container namespace */ > > + if (key->umh_token) > > + ret = call_usermodehelper_keys_service(argv[0], argv, envp, > > + keyring, key->umh_token, > > + UMH_WAIT_PROC); > > + else > > + ret = call_usermodehelper_keys(argv[0], argv, envp, > > + keyring, UMH_WAIT_PROC); > > call_usermodehelper_keys_service() would appear to be superfluous. If > key->umh_token is 0, you call call_usermodehelper_keys() which then calls > call_usermodehelper_keys_service() with a 0 token... Yeah, not really worth the additional function. IIRC there are no other callers of call_usermodehelper_keys(). > > David