Skip to content

Commit 4bc799d

Browse files
samitolvanenJames Morris
authored andcommitted
security: fix the key_permission LSM hook function type
Commit 8c0637e ("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: 8c0637e ("keys: Make the KEY_NEED_* perms an enum rather than a mask") Signed-off-by: Sami Tolvanen <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: James Morris <[email protected]>
1 parent 4877846 commit 4bc799d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/lsm_hook_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ LSM_HOOK(int, 0, key_alloc, struct key *key, const struct cred *cred,
360360
unsigned long flags)
361361
LSM_HOOK(void, LSM_RET_VOID, key_free, struct key *key)
362362
LSM_HOOK(int, 0, key_permission, key_ref_t key_ref, const struct cred *cred,
363-
unsigned perm)
363+
enum key_need_perm need_perm)
364364
LSM_HOOK(int, 0, key_getsecurity, struct key *key, char **_buffer)
365365
#endif /* CONFIG_KEYS */
366366

0 commit comments

Comments
 (0)