aboutsummaryrefslogtreecommitdiff
path: root/security/security.c
diff options
context:
space:
mode:
authorGravatar Khadija Kamran <kamrankhadijadj@gmail.com> 2023-08-23 12:17:29 +0500
committerGravatar Paul Moore <paul@paul-moore.com> 2023-09-13 18:09:35 -0400
commit4a00c673068e72c12d243f5c31000246d6984e44 (patch)
tree197059d93d35905fe91aa75b4b76a48d834a798a /security/security.c
parentlsm: constify 'sb' parameter in security_quotactl() (diff)
downloadlinux-4a00c673068e72c12d243f5c31000246d6984e44.tar.gz
linux-4a00c673068e72c12d243f5c31000246d6984e44.tar.bz2
linux-4a00c673068e72c12d243f5c31000246d6984e44.zip
lsm: constify 'file' parameter in security_bprm_creds_from_file()
The 'bprm_creds_from_file' hook has implementation registered in commoncap. Looking at the function implementation we observe that the 'file' parameter is not changing. Mark the 'file' parameter of LSM hook security_bprm_creds_from_file() as 'const' since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/security.c b/security/security.c
index b944b19e4512..bde8813e89ff 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1079,7 +1079,7 @@ int security_bprm_creds_for_exec(struct linux_binprm *bprm)
*
* Return: Returns 0 if the hook is successful and permission is granted.
*/
-int security_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file)
+int security_bprm_creds_from_file(struct linux_binprm *bprm, const struct file *file)
{
return call_int_hook(bprm_creds_from_file, 0, bprm, file);
}