mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 07:16:21 +09:00
LSM: Check for NULL cred-security on free
commit a5795fd38e
upstream.
From: Casey Schaufler <casey@schaufler-ca.com>
Check that the cred security blob has been set before trying
to clean it up. There is a case during credential initialization
that could result in this.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Acked-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
Reported-by: syzbot+69ca07954461f189e808@syzkaller.appspotmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
993e65a624
commit
b9f9379336
|
@ -993,6 +993,13 @@ int security_cred_alloc_blank(struct cred *cred, gfp_t gfp)
|
|||
|
||||
void security_cred_free(struct cred *cred)
|
||||
{
|
||||
/*
|
||||
* There is a failure case in prepare_creds() that
|
||||
* may result in a call here with ->security being NULL.
|
||||
*/
|
||||
if (unlikely(cred->security == NULL))
|
||||
return;
|
||||
|
||||
call_void_hook(cred_free, cred);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user