aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/lsm_hook_defs.h
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2020-06-15 11:12:32 -0700
committerJames Morris <jmorris@namei.org>2020-06-22 10:36:25 -0700
commit4bc799dcb67066e0531004d5bdbe755bb02b5488 (patch)
treee36e77d8dbe7b3707c43bbc7582fa3f295d60e20 /include/linux/lsm_hook_defs.h
parentLinux 5.8-rc2 (diff)
downloadwireguard-linux-4bc799dcb67066e0531004d5bdbe755bb02b5488.tar.xz
wireguard-linux-4bc799dcb67066e0531004d5bdbe755bb02b5488.zip
security: fix the key_permission LSM hook function type
Commit 8c0637e950d6 ("keys: Make the KEY_NEED_* perms an enum rather than a mask") changed the type of the key_permission callback functions, but didn't change the type of the hook, which trips indirect call checking with Control-Flow Integrity (CFI). This change fixes the issue by changing the hook type to match the functions. Fixes: 8c0637e950d6 ("keys: Make the KEY_NEED_* perms an enum rather than a mask") Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/linux/lsm_hook_defs.h')
-rw-r--r--include/linux/lsm_hook_defs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
index 6791813cd439..24f6683f1cfc 100644
--- a/include/linux/lsm_hook_defs.h
+++ b/include/linux/lsm_hook_defs.h
@@ -360,7 +360,7 @@ LSM_HOOK(int, 0, key_alloc, struct key *key, const struct cred *cred,
unsigned long flags)
LSM_HOOK(void, LSM_RET_VOID, key_free, struct key *key)
LSM_HOOK(int, 0, key_permission, key_ref_t key_ref, const struct cred *cred,
- unsigned perm)
+ enum key_need_perm need_perm)
LSM_HOOK(int, 0, key_getsecurity, struct key *key, char **_buffer)
#endif /* CONFIG_KEYS */