Custom LSM: getting a null pointer dereference when trying to access a task security blob

Denis Obrezkov denisobrezkov at gmail.com
Mon Jan 24 09:56:13 UTC 2022


It seems I didn't implement cred_prepare and it was crucial.

On 23.01.22 20:58, Denis Obrezkov wrote:

> I have two hypotheses. First is that my keylock_known_system is not
> visible to other tasks (though it is initialized in a global scope of my
> .c file). Second is that I didn't implement some crucial hooks and a new
> task is created without a label. I have implemented those hooks:
> 
> 
> static struct security_hook_list keylock_hooks[] __lsm_ro_after_init = {
>         LSM_HOOK_INIT(inode_alloc_security, keylock_inode_alloc_security),
>         LSM_HOOK_INIT(inode_init_security, keylock_inode_init_security),
>         LSM_HOOK_INIT(task_to_inode, keylock_task_to_inode),
>         LSM_HOOK_INIT(cred_transfer, keylock_cred_transfer),
>         LSM_HOOK_INIT(cred_alloc_blank, keylock_cred_alloc_blank),
> 
> };
> 
> 
> And I initialized my KeyLock LSM in a way similar to that of SMACK.
> 
> --
> Regards, Denis Obrezkov

-- 
Regards, Denis Obrezkov



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