lsm: constify the 'target' parameter in security_capget()
authorKhadija Kamran <kamrankhadijadj@gmail.com>
Mon, 7 Aug 2023 06:59:29 +0000 (11:59 +0500)
committerPaul Moore <paul@paul-moore.com>
Tue, 8 Aug 2023 20:48:47 +0000 (16:48 -0400)
commit6672efbb685f7c9c9df005beb839e1942fd6b34e
treee29f61323cc3b5923c4013248381cb6382c2ca0e
parentbd1f5934e460eb11f42278fe8450a87d64bf70f5
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>
include/linux/lsm_hook_defs.h
include/linux/security.h
kernel/capability.c
security/apparmor/lsm.c
security/commoncap.c
security/security.c
security/selinux/hooks.c