diff options
author | James Morris <james.morris@microsoft.com> | 2019-01-23 01:33:10 +0300 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2019-01-23 01:33:10 +0300 |
commit | 9624d5c9c7ff6836bbf9f9b230fd1fcf3d56f91a (patch) | |
tree | e9c1e5d2400ad20c5a9cd633b52a42a00d1d98cb /security/security.c | |
parent | 3e8c73671244af16f1a6042f1c10d13b75cd1156 (diff) | |
parent | 49a57857aeea06ca831043acbb0fa5e0f50602fd (diff) | |
download | linux-9624d5c9c7ff6836bbf9f9b230fd1fcf3d56f91a.tar.xz |
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.
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c index 3664fb9d5cf7..b6bff646d373 100644 --- a/security/security.c +++ b/security/security.c @@ -1472,6 +1472,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); kfree(cred->security); |