Commit Graph

3 Commits

Author SHA1 Message Date
Kshitiz Varshney
407dd77f7b security/keys/secure_key: Fix "Bad Address" error while generating keys using keyctl
An internal buffer is allocated for getting the keys out from the read method
first before copying them out to userspace without holding the lock.
To handle this update, changed copy_to_user() to memcpy()in secure_read() as
secure key data is being copied in kernel buffer first and then to userspace by
keyctl.

Signed-off-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
2023-10-30 15:52:39 +08:00
Kshitiz Varshney
8f95718718 LF-4132: Replaced kzfree with kfree_sensitive
Replaced kzfree with kfree_sensitive as kzfree has become
obsolete and it is no more used for kernel 5.10.35.

Signed-off-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
2023-10-30 15:52:39 +08:00
Udit Agarwal
6ba5bd5e53 security/keys/secure_key: Adds the secure key support based on CAAM.
Secure keys are derieved using CAAM crypto block.

Secure keys derieved are the random number symmetric keys from CAAM.
Blobs corresponding to the key are formed using CAAM. User space
will only be able to view the blob of the key.

Signed-off-by: Udit Agarwal <udit.agarwal@nxp.com>

Reviewed-by: Sahil Malhotra <sahil.malhotra@nxp.com>
[ Aisheng: fix minior conflicts due to 
47f9c27968 ("KEYS: trusted: Create trusted keys subsystem") ]
Sign-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:52:39 +08:00