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.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -360,7 +360,7 @@ LSM_HOOK(int, 0, key_alloc, struct key *key, const struct cred *cred, · 359 unmodified lines | |||
| 360 | unsigned long flags) | 360 | unsigned long flags) |
| 361 | LSM_HOOK(void, LSM_RET_VOID, key_free, struct key *key) | 361 | LSM_HOOK(void, LSM_RET_VOID, key_free, struct key *key) |
| 362 | LSM_HOOK(int, 0, key_permission, key_ref_t key_ref, const struct cred *cred, | 362 | 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) |
| 364 | LSM_HOOK(int, 0, key_getsecurity, struct key *key, char **_buffer) | 364 | LSM_HOOK(int, 0, key_getsecurity, struct key *key, char **_buffer) |
| 365 | #endif /* CONFIG_KEYS */ | 365 | #endif /* CONFIG_KEYS */ |
| 366 | 366 | ||