[PATCH v13 2/5] security: Count the LSMs enabled at compile time
Paul Moore
paul at paul-moore.com
Wed Jul 3 14:54:52 UTC 2024
On Wed, Jul 3, 2024 at 9:12 AM KP Singh <kpsingh at kernel.org> wrote:
> > On 3 Jul 2024, at 11:44, Rasmus Villemoes <rasmus.villemoes at prevas.dk> wrote:
> > KP Singh <kpsingh at kernel.org> writes:
> >
> >> These macros are a clever trick to determine a count of the number of
> >> LSMs that are enabled in the config to ascertain the maximum number of
> >> static calls that need to be configured per LSM hook.
...
> > Instead of all this trickery with defining temporary, never used again,
> > macros expanding to something with trailing comma or not, what about
> > this simpler (at least in terms of LOC, but IMO also readability)
> > approach:
...
> I actually prefer the version we have now from a readability perspective, it makes it more explicit (the check about the CONFIG_* being enabled and counting them). let's keep this as an incremental change that you can propose :) once the patches are merged.
I prefer the original approach by KP as well, let's leave it as-is.
IMO, it's far from the worst of the macro shenanigans in this patchset
(or existing LSM code for that matter).
--
paul-moore.com
More information about the Linux-security-module-archive
mailing list