diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2020-10-06 23:11:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-07 10:23:39 +0300 |
commit | 200da27ab32d89ca43bd8ef010f84b205e5c780a (patch) | |
tree | b89c08dc008328a98638c8aabda8cdb97e1ec5a1 /include/linux/lsm_hook_defs.h | |
parent | 2827d98bc5d65ebfa78cfa32ebddea3a6f60f56d (diff) | |
download | linux-200da27ab32d89ca43bd8ef010f84b205e5c780a.tar.xz |
LSM: Fix type of id parameter in kernel_post_load_data prototype
Clang warns:
security/security.c:1716:59: warning: implicit conversion from
enumeration type 'enum kernel_load_data_id' to different enumeration
type 'enum kernel_read_file_id' [-Wenum-conversion]
ret = call_int_hook(kernel_post_load_data, 0, buf, size, id,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
security/security.c:715:22: note: expanded from macro 'call_int_hook'
RC = P->hook.FUNC(__VA_ARGS__); \
~ ^~~~~~~~~~~
1 warning generated.
There is a mismatch between the id parameter type in
security_kernel_post_load_data and the function pointer prototype that
is created by the LSM_HOOK macro in the security_list_options union. Fix
the type in the LSM_HOOK macro as 'enum kernel_load_data_id' is what is
expected.
Fixes: b64fcae74b6d ("LSM: Introduce kernel_post_load_data() hook")
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20201006201115.716550-1-natechancellor@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/lsm_hook_defs.h')
-rw-r--r-- | include/linux/lsm_hook_defs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h index d67cb3502310..32a940117e7a 100644 --- a/include/linux/lsm_hook_defs.h +++ b/include/linux/lsm_hook_defs.h @@ -186,7 +186,7 @@ LSM_HOOK(int, 0, kernel_create_files_as, struct cred *new, struct inode *inode) LSM_HOOK(int, 0, kernel_module_request, char *kmod_name) LSM_HOOK(int, 0, kernel_load_data, enum kernel_load_data_id id, bool contents) LSM_HOOK(int, 0, kernel_post_load_data, char *buf, loff_t size, - enum kernel_read_file_id id, char *description) + enum kernel_load_data_id id, char *description) LSM_HOOK(int, 0, kernel_read_file, struct file *file, enum kernel_read_file_id id, bool contents) LSM_HOOK(int, 0, kernel_post_read_file, struct file *file, char *buf, |