From: James Morris Date: Tue, 22 Jan 2019 22:33:10 +0000 (-0800) Subject: Merge tag 'v5.0-rc3' into next-general X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9624d5c9c7ff6836bbf9f9b230fd1fcf3d56f91a;p=linux.git Merge tag 'v5.0-rc3' into next-general Sync to Linux 5.0-rc3 to pull in the VFS changes which impacted a lot of the LSM code. --- 9624d5c9c7ff6836bbf9f9b230fd1fcf3d56f91a diff --cc security/security.c index 3664fb9d5cf71,55bc49027ba97..b6bff646d373f --- a/security/security.c +++ b/security/security.c @@@ -1472,10 -1027,14 +1472,17 @@@ int security_cred_alloc_blank(struct cr 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); + + kfree(cred->security); + cred->security = NULL; } int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp)