LSM: Check for NULL cred-security on free
authorJames Morris <james.morris@microsoft.com>
Wed, 16 Jan 2019 23:41:11 +0000 (15:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 20:40:35 +0000 (21:40 +0100)
commita19aedf1a77c2e426c9810aece80646283cc2808
tree0e86830ea92e22577d5efb9da8c5c73eb76b55e5
parenta72e572f8a2d61db2f4d17e1de17fb92573870ef
LSM: Check for NULL cred-security on free

commit a5795fd38ee8194451ba3f281f075301a3696ce2 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>
security/security.c