Skip to content

Commit 200da27

Browse files
nathanchancegregkh
authored andcommitted
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: b64fcae ("LSM: Introduce kernel_post_load_data() hook") Acked-by: Kees Cook <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2827d98 commit 200da27

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
@@ -186,7 +186,7 @@ LSM_HOOK(int, 0, kernel_create_files_as, struct cred *new, struct inode *inode)
186186
LSM_HOOK(int, 0, kernel_module_request, char *kmod_name)
187187
LSM_HOOK(int, 0, kernel_load_data, enum kernel_load_data_id id, bool contents)
188188
LSM_HOOK(int, 0, kernel_post_load_data, char *buf, loff_t size,
189-
enum kernel_read_file_id id, char *description)
189+
enum kernel_load_data_id id, char *description)
190190
LSM_HOOK(int, 0, kernel_read_file, struct file *file,
191191
enum kernel_read_file_id id, bool contents)
192192
LSM_HOOK(int, 0, kernel_post_read_file, struct file *file, char *buf,

0 commit comments

Comments
 (0)