diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 11:21:12 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 11:21:12 -0700 |
commit | 172f993a2941ec60685c7e33af8be701759de1ab (patch) | |
tree | 2ee072d56de4a1bfe4ee6873941870837162ffba /security/smack/smackfs.c | |
parent | 7272c30b6fbc051bf8a3f3c973e64f230c91c8b3 (diff) | |
parent | e3fea3f70fd68af0574a5f24246cdb4ed07f2b74 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem bugfixes from James Morris.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
selinux: fix selinux_inode_setxattr oops
KEYS: linux/key-type.h needs linux/errno.h
smack: off by one error
Diffstat (limited to 'security/smack/smackfs.c')
-rw-r--r-- | security/smack/smackfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index d31e6d957c2..b1b768e4049 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -323,11 +323,11 @@ static int smk_parse_long_rule(const char *data, struct smack_rule *rule, int datalen; int rc = -1; - /* - * This is probably inefficient, but safe. - */ + /* This is inefficient */ datalen = strlen(data); - subject = kzalloc(datalen, GFP_KERNEL); + + /* Our first element can be 64 + \0 with no spaces */ + subject = kzalloc(datalen + 1, GFP_KERNEL); if (subject == NULL) return -1; object = kzalloc(datalen, GFP_KERNEL); |