diff options
author | Khadija Kamran <kamrankhadijadj@gmail.com> | 2023-08-07 08:59:29 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2023-08-08 22:48:47 +0200 |
commit | 6672efbb685f7c9c9df005beb839e1942fd6b34e (patch) | |
tree | e29f61323cc3b5923c4013248381cb6382c2ca0e /security/security.c | |
parent | lsm: add comment block for security_sk_classify_flow LSM hook (diff) | |
download | linux-6672efbb685f7c9c9df005beb839e1942fd6b34e.tar.xz linux-6672efbb685f7c9c9df005beb839e1942fd6b34e.zip |
lsm: constify the 'target' parameter in security_capget()
Three LSMs register the implementations for the "capget" hook: AppArmor,
SELinux, and the normal capability code. Looking at the function
implementations we may observe that the first parameter "target" is not
changing.
Mark the first argument "target" of LSM hook security_capget() as
"const" since it will not be changing in the LSM hook.
cap_capget() LSM hook declaration exceeds the 80 characters per line
limit. Split the function declaration to multiple lines to decrease the
line length.
Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com>
[PM: align the cap_capget() declaration, spelling fixes]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/security.c b/security/security.c index 9177fd0968bd..6962ea38a98f 100644 --- a/security/security.c +++ b/security/security.c @@ -894,7 +894,7 @@ int security_ptrace_traceme(struct task_struct *parent) * * Return: Returns 0 if the capability sets were successfully obtained. */ -int security_capget(struct task_struct *target, +int security_capget(const struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted) |