diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-07 17:34:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-07 17:34:07 -0400 |
commit | 11c7b03d42a847db90862d0f9d8be6ce9b2f0553 (patch) | |
tree | 9c1d9e95c8ae09b4ee44821a9e570247d5a85a72 /security/selinux | |
parent | 6be48f2940af9ea8d93c23a0dd8e322672c92efd (diff) | |
parent | 73203361468894c3c017bfbdd9ddcbb468039604 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem updates from James Morris:
"Nothing major for this kernel, just maintenance updates"
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (21 commits)
apparmor: add the ability to report a sha1 hash of loaded policy
apparmor: export set of capabilities supported by the apparmor module
apparmor: add the profile introspection file to interface
apparmor: add an optional profile attachment string for profiles
apparmor: add interface files for profiles and namespaces
apparmor: allow setting any profile into the unconfined state
apparmor: make free_profile available outside of policy.c
apparmor: rework namespace free path
apparmor: update how unconfined is handled
apparmor: change how profile replacement update is done
apparmor: convert profile lists to RCU based locking
apparmor: provide base for multiple profiles to be replaced at once
apparmor: add a features/policy dir to interface
apparmor: enable users to query whether apparmor is enabled
apparmor: remove minimum size check for vmalloc()
Smack: parse multiple rules per write to load2, up to PAGE_SIZE-1 bytes
Smack: network label match fix
security: smack: add a hash table to quicken smk_find_entry()
security: smack: fix memleak in smk_write_rules_list()
xattr: Constify ->name member of "struct xattr".
...
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index c956390a9136..a5091ec06aa6 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -2587,7 +2587,8 @@ static int selinux_dentry_init_security(struct dentry *dentry, int mode, | |||
2587 | } | 2587 | } |
2588 | 2588 | ||
2589 | static int selinux_inode_init_security(struct inode *inode, struct inode *dir, | 2589 | static int selinux_inode_init_security(struct inode *inode, struct inode *dir, |
2590 | const struct qstr *qstr, char **name, | 2590 | const struct qstr *qstr, |
2591 | const char **name, | ||
2591 | void **value, size_t *len) | 2592 | void **value, size_t *len) |
2592 | { | 2593 | { |
2593 | const struct task_security_struct *tsec = current_security(); | 2594 | const struct task_security_struct *tsec = current_security(); |
@@ -2595,7 +2596,7 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir, | |||
2595 | struct superblock_security_struct *sbsec; | 2596 | struct superblock_security_struct *sbsec; |
2596 | u32 sid, newsid, clen; | 2597 | u32 sid, newsid, clen; |
2597 | int rc; | 2598 | int rc; |
2598 | char *namep = NULL, *context; | 2599 | char *context; |
2599 | 2600 | ||
2600 | dsec = dir->i_security; | 2601 | dsec = dir->i_security; |
2601 | sbsec = dir->i_sb->s_security; | 2602 | sbsec = dir->i_sb->s_security; |
@@ -2631,19 +2632,13 @@ static int selinux_inode_init_security(struct inode *inode, struct inode *dir, | |||
2631 | if (!ss_initialized || !(sbsec->flags & SE_SBLABELSUPP)) | 2632 | if (!ss_initialized || !(sbsec->flags & SE_SBLABELSUPP)) |
2632 | return -EOPNOTSUPP; | 2633 | return -EOPNOTSUPP; |
2633 | 2634 | ||
2634 | if (name) { | 2635 | if (name) |
2635 | namep = kstrdup(XATTR_SELINUX_SUFFIX, GFP_NOFS); | 2636 | *name = XATTR_SELINUX_SUFFIX; |
2636 | if (!namep) | ||
2637 | return -ENOMEM; | ||
2638 | *name = namep; | ||
2639 | } | ||
2640 | 2637 | ||
2641 | if (value && len) { | 2638 | if (value && len) { |
2642 | rc = security_sid_to_context_force(newsid, &context, &clen); | 2639 | rc = security_sid_to_context_force(newsid, &context, &clen); |
2643 | if (rc) { | 2640 | if (rc) |
2644 | kfree(namep); | ||
2645 | return rc; | 2641 | return rc; |
2646 | } | ||
2647 | *value = context; | 2642 | *value = context; |
2648 | *len = clen; | 2643 | *len = clen; |
2649 | } | 2644 | } |