Re: [PATCH v2 4/6] Audit: Add record for multiple task security contexts

Paul Moore
2025-03-13T12:29:43Z

On March 12, 2025 7:51:36 PM Paul Moore <paul@paul-moore.com> wrote:
> On Mar 7, 2025 Casey Schaufler <casey@schaufler-ca.com> wrote:

...

>
>> diff --git a/include/linux/security.h b/include/linux/security.h
>> index 540894695c4b..79a9bf4a7cdd 100644
>> --- a/include/linux/security.h
>> +++ b/include/linux/security.h
>> @@ -168,6 +168,7 @@ struct lsm_prop {
>>
>> extern const char *const lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1];
>> extern u32 lsm_active_cnt;
>> +extern u32 lsm_subjctx_cnt;
>
> I'm not loving this. More below, but I'd really like to hide some of
> this detail inside a LSM API/hook if possible.

Thinking more about this I think we can't go with a LSM_MAX_PROPS, or
similar determined at build time since we have the ability to toggle LSMs
at boot. Need to think on this some more, but the answer is going to have
to be a variable and not a #define.

The LSM init work I'm doing right now directly impacts this, and I'm in the
final stages now. Let me see what looks reasonable and I'll get back to you.

--
paul-moore.com
>