[PATCH v2] lsm: use unrcu_pointer() for current->cred in security_init()
Paul Moore
paul at paul-moore.com
Thu Nov 20 21:27:05 UTC 2025
On Thu, Nov 20, 2025 at 2:48 AM Xiu Jianfeng <xiujianfeng at huawei.com> wrote:
> On 11/19/2025 11:36 PM, Paul Moore wrote:
> > We need to directly allocate the cred's LSM state for the initial task
> > when we initialize the LSM framework. Unfortunately, this results in a
> > RCU related type mismatch, use the unrcu_pointer() macro to handle this
> > a bit more elegantly.
> >
> > The explicit type casting still remains as we need to work around the
> > constification of current->cred in this particular case.
> >
> > Signed-off-by: Paul Moore <paul at paul-moore.com>
>
> Reviewed-by: Xiu Jianfeng <xiujianfeng at huawei.com>
Thanks for the review, I just merged this into lsm/dev.
--
paul-moore.com
More information about the Linux-security-module-archive
mailing list