[PATCH 1/2] lsm: change 'target' parameter to 'const' in security_capget LSM hook

Paul Moore paul at paul-moore.com
Mon Jul 31 23:12:46 UTC 2023


On Mon, Jul 31, 2023 at 1:02 PM Alison Schofield
<alison.schofield at intel.com> wrote:
> On Mon, Jul 31, 2023 at 12:07:31PM +0500, Khadija Kamran wrote:
> > 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.
>
>
> The commit message may be simplified, from this:
> [PATCH 1/2] lsm: change 'target' parameter to 'const' in security_capget LSM hook
>
> to something like this:
> [PATCH 1/2] lsm: Constify the target parameter in security_capget()
>
> "Constify" is the commonly used language in git logs.
> See git log --pretty=oneline --abbrev-commit | grep Constify

I'm not overly worried about the subject line; yes, Allison's
suggestion is an improvement, but the original is okay.  However, I
would like to see patches 1/2 and 2/2 squashed together into a single
patch.  If patch 1/2 hadn't already touched the function declaration
line that was too long there may have been an argument for keeping the
patchset as two patches, but since patch 1/2 does modify the function
declaration we might as well wrap that declaration line in that patch
too.

--
paul-moore.com



More information about the Linux-security-module-archive mailing list