Re: [RFC PATCH 5 7/7] KEYS: exec request key within service thread of key creator

From: Ian Kent
Date: Mon Apr 06 2015 - 20:54:44 EST


On Thu, 2015-04-02 at 13:58 +0100, David Howells wrote:
> Ian Kent <raven@xxxxxxxxxx> 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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/