Commit a5795fd3 authored by James Morris's avatar James Morris

LSM: Check for NULL cred-security on free

From: Casey Schaufler <>

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: default avatarCasey Schaufler <>
Acked-by: default avatarJohn Johansen <>
Signed-off-by: default avatarJames Morris <>
parent 9474f4e7
......@@ -1027,6 +1027,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))
call_void_hook(cred_free, cred);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment