Dave Jiang <[email protected]> wrote:

> +     depends on KEYS

That needs to be in patch 2 where you create a keyring.

> +     char desc[NVDIMM_KEY_DESC_LEN + strlen(NVDIMM_PREFIX)];

You should be using sizeof() not strlen() and do you need + 1 for the NUL
char?

> +     sprintf(desc, "%s%s", NVDIMM_PREFIX, nvdimm->dimm_id);

NVDIMM_PREFIX is a constant string.  I would recommend either declaring it as
a const char[] or just sticking it in the format string in place of the %s:

        sprintf(desc, NVDIMM_PREFIX "%s", nvdimm->dimm_id);

> +             if (!cached_key) {
> +                     key_link(nvdimm_keyring, key);
> +                     nvdimm->key = key;
> +                     key->perm |= KEY_USR_SEARCH;
> +             }

Ummm...  You're altering the key permission?  That's not really yours to
change.

> +static int nvdimm_check_key_len(unsigned short len, bool update)
> +{
> +     if (len == (NVDIMM_PASSPHRASE_LEN * 2) && update)
> +             return 0;

In the cover you said:

        - Modified "update" to take two key ids and and use lookup_user_key()
          in order to improve security.  (David)

is this a holdover?

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

Reply via email to