Dave Jiang <[email protected]> wrote:

> > I wonder if you could just use &init_cred instead.
> 
> You mean also instead of a dedicated keyring, just use the existing ones
> that comes with init_cred as well?

You don't need a cred to use your own keyring that I can see.  If you look at
nvdimm_search_key(), you're not actually using the cred, but just taking the
keyring out of it:

        keyref = keyring_search(make_key_ref(nvdimm_cred->thread_keyring, 1),
                        &nvdimm_key_type, nvdimm->dimm_id);

Further, when you call request_key(), you want to look in the user's keyrings,
I presume, so you can't actually override current->cred with nvdimm_cred.

As far as I can see, you don't use nvdimm_cred, except as somewhere to stash
the keyring pointer.  You could just skip the creds and store the keyring
pointer directly.

David
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to