KEYS: Add new function key_create()
authorThomas Weißschuh <linux@weissschuh.net>
Mon, 9 Jan 2023 23:59:42 +0000 (23:59 +0000)
committerJarkko Sakkinen <jarkko@kernel.org>
Mon, 13 Feb 2023 08:11:20 +0000 (10:11 +0200)
commit6c1976addf3623e979b7a954e216004d559bcb42
tree67503e23e9cbeb5daa7ff7db3f074f3997f06b64
parent06b53b02945e3021addc6af2da3ac999d2221d23
KEYS: Add new function key_create()

key_create() works like key_create_or_update() but does not allow
updating an existing key, instead returning ERR_PTR(-EEXIST).

key_create() will be used by the blacklist keyring which should not
create duplicate entries or update existing entries.
Instead a dedicated message with appropriate severity will be logged.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
include/linux/key.h
security/keys/key.c