diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/smack/smack_lsm.c | 2 | ||||
-rw-r--r-- | security/smack/smackfs.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index b11ab23b328b..afa5ad0e7f72 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -923,7 +923,7 @@ static int smack_inode_setxattr(struct dentry *dentry, const char *name, | |||
923 | rc = -EPERM; | 923 | rc = -EPERM; |
924 | 924 | ||
925 | if (rc == 0 && check_import) { | 925 | if (rc == 0 && check_import) { |
926 | skp = smk_import_entry(value, size); | 926 | skp = size ? smk_import_entry(value, size) : NULL; |
927 | if (skp == NULL || (check_star && | 927 | if (skp == NULL || (check_star && |
928 | (skp == &smack_known_star || skp == &smack_known_web))) | 928 | (skp == &smack_known_star || skp == &smack_known_web))) |
929 | rc = -EINVAL; | 929 | rc = -EINVAL; |
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 3c720ff10591..56a1439786a9 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c | |||
@@ -1677,7 +1677,7 @@ static ssize_t smk_write_onlycap(struct file *file, const char __user *buf, | |||
1677 | if (smack_onlycap != NULL && smack_onlycap != skp) | 1677 | if (smack_onlycap != NULL && smack_onlycap != skp) |
1678 | return -EPERM; | 1678 | return -EPERM; |
1679 | 1679 | ||
1680 | data = kzalloc(count, GFP_KERNEL); | 1680 | data = kzalloc(count + 1, GFP_KERNEL); |
1681 | if (data == NULL) | 1681 | if (data == NULL) |
1682 | return -ENOMEM; | 1682 | return -ENOMEM; |
1683 | 1683 | ||
@@ -2228,7 +2228,7 @@ static ssize_t smk_write_syslog(struct file *file, const char __user *buf, | |||
2228 | if (!smack_privileged(CAP_MAC_ADMIN)) | 2228 | if (!smack_privileged(CAP_MAC_ADMIN)) |
2229 | return -EPERM; | 2229 | return -EPERM; |
2230 | 2230 | ||
2231 | data = kzalloc(count, GFP_KERNEL); | 2231 | data = kzalloc(count + 1, GFP_KERNEL); |
2232 | if (data == NULL) | 2232 | if (data == NULL) |
2233 | return -ENOMEM; | 2233 | return -ENOMEM; |
2234 | 2234 | ||