Skip to content
Commit 200da27a authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Greg Kroah-Hartman
Browse files

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: b64fcae7 ("LSM: Introduce kernel_post_load_data() hook")
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20201006201115.716550-1-natechancellor@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2827d98b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment