[RFC 04/12] x86/mm: Add helper functions to manage memory encryption keys
From: dhowells@redhat.com (David Howells)
Date: 2018-09-11 22:56:58
Also in:
keyrings, linux-mm
From: dhowells@redhat.com (David Howells)
Date: 2018-09-11 22:56:58
Also in:
keyrings, linux-mm
Alison Schofield [off-list ref] wrote:
+void mktme_map_set_keyid(int keyid, unsigned int serial)
+{
+ mktme_map->serial[keyid] = serial;
+ mktme_map->mapped_keyids++;
+}It appears that 'serial' should be key_serial_t. Note that you *aren't* allowed to cache key serial numbers inside the kernel. You must cache the struct key * instead and hold a reference to the key. This will prevent the key from being destroyed whilst it is in use. David