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

From: David Howells
Date: Thu Apr 02 2015 - 08:58:20 EST


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.

> + umh_wq_put_token(key->umh_token);

Does gc.c need an extra #include for this?

> + /* 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?

> - 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...

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/