diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-24 20:58:51 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-24 20:58:51 -0400 |
| commit | 3be4aaf4e2d3eb95cce7835e8df797ae65ae5ac1 (patch) | |
| tree | 3238bb369bdcadc8dec4d7fd31fdf36b733aeb21 /security | |
| parent | 24cac7009cb1b211f1c793ecb6a462c03dc35818 (diff) | |
| parent | 1f5781725dcbb026438e77091c91a94f678c3522 (diff) | |
Merge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull userns bug fix from Eric Biederman:
"Just a small fix to properly set the return code on error"
* 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
commoncap: Handle memory allocation failure.
Diffstat (limited to 'security')
| -rw-r--r-- | security/commoncap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/security/commoncap.c b/security/commoncap.c index 48620c93d697..1ce701fcb3f3 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
| @@ -449,6 +449,8 @@ int cap_inode_getsecurity(struct inode *inode, const char *name, void **buffer, | |||
| 449 | magic |= VFS_CAP_FLAGS_EFFECTIVE; | 449 | magic |= VFS_CAP_FLAGS_EFFECTIVE; |
| 450 | memcpy(&cap->data, &nscap->data, sizeof(__le32) * 2 * VFS_CAP_U32); | 450 | memcpy(&cap->data, &nscap->data, sizeof(__le32) * 2 * VFS_CAP_U32); |
| 451 | cap->magic_etc = cpu_to_le32(magic); | 451 | cap->magic_etc = cpu_to_le32(magic); |
| 452 | } else { | ||
| 453 | size = -ENOMEM; | ||
| 452 | } | 454 | } |
| 453 | } | 455 | } |
| 454 | kfree(tmpbuf); | 456 | kfree(tmpbuf); |
