Skip to contentSkip to conversation

RESEND: security: keys: Making key_type_lookup() public

DISCUSSION Douglas Miller 1 participant 1 message Jan 12, 2022 Keys/keyrings

lore
Share & tools
lore
#0 lore raw

I'd like to explore the possibility of making key_type_lookup() available to other kernel components, the same way that [un]register_key_type() is available. I'm wondering if there is a reason that this function shouldn't be available for use.

The reason we would like to use this function is for support of SED-OPAL drives using block/sed-opal.c. On certain PowerPC platforms there is a Platform Key Store (PKS) available and we want to use that as a repository for SED-OPAL PEKs.

Rather than add platform-specific code to block/sed-opal.c, we are looking at using the Linux keyring facility, and then providing a special key_type, for the PKS driver, on platforms that support it. We would like to have block/sed-opal.c simply call key_type_lookup() for the PKS key type, and then (if found) instantiate the keys into the keyring. On platforms without a PKS, the same keyring can be used to instantiate keys of other types, manually or automatically. These keys can then be used directly in SED-OPAL commands without the need to read them into userland process memory and pass them in system calls. Any platform (non-PowerPC) that might have a Platform Key Store could implement this PKS key type as well.

Please let us know if this acceptable. It seems that key_type_lookup() is a natural companion to [un]register_key_type() - which are already exported symbols.

Thanks,
Doug