summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorKhadija Kamran <kamrankhadijadj@gmail.com>2023-08-23 12:01:28 +0300
committerPaul Moore <paul@paul-moore.com>2023-09-14 22:35:36 +0300
commit20a2aa47097aae7016209c4dbe392b3b25e0d883 (patch)
tree4561b3f4cccc30cc03aa1ff16217b3f03b7f6f84 /security
parenta721f7b8c3548e943e514a957f2a37f4763b9888 (diff)
downloadlinux-20a2aa47097aae7016209c4dbe392b3b25e0d883.tar.xz
lsm: constify 'sb' parameter in security_sb_kern_mount()
The "sb_kern_mount" hook has implementation registered in SELinux. Looking at the function implementation we observe that the "sb" parameter is not changing. Mark the "sb" parameter of LSM hook security_sb_kern_mount() as "const" since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com> [PM: minor merge fuzzing due to other constification patches] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/security.c2
-rw-r--r--security/selinux/hooks.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/security/security.c b/security/security.c
index e4aec0f65f75..7b0052e96806 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1319,7 +1319,7 @@ EXPORT_SYMBOL(security_sb_remount);
*
* Return: Returns 0 if permission is granted.
*/
-int security_sb_kern_mount(struct super_block *sb)
+int security_sb_kern_mount(const struct super_block *sb)
{
return call_int_hook(sb_kern_mount, 0, sb);
}
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e9ee008a9537..195db92ac99c 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2721,7 +2721,7 @@ out_bad_option:
return -EINVAL;
}
-static int selinux_sb_kern_mount(struct super_block *sb)
+static int selinux_sb_kern_mount(const struct super_block *sb)
{
const struct cred *cred = current_cred();
struct common_audit_data ad;