diff options
author | Lukasz Pawelczyk <l.pawelczyk@samsung.com> | 2015-08-25 06:39:46 -0400 |
---|---|---|
committer | Casey Schaufler <casey@schaufler-ca.com> | 2015-10-09 18:12:46 -0400 |
commit | 5f2bfe2f1de8b745dc294acaf2ca2ad68e09b374 (patch) | |
tree | 0ba2486e5d6e7a3a4f5a5c4b61a5eaa21e72b3b7 /security/smack/smackfs.c | |
parent | 049e6dde7e57f0054fdc49102e7ef4830c698b46 (diff) |
Smack: fix a NULL dereference in wrong smack_import_entry() usage
'commit e774ad683f42 ("smack: pass error code through pointers")'
made this function return proper error codes instead of NULL. Reflect that.
This is a fix for a NULL dereference introduced in
'commit 21abb1ec414c ("Smack: IPv6 host labeling")'
echo "$SOME_IPV6_ADDR \"test" > /smack/ipv6host
(this should return EINVAL, it doesn't)
cat /smack/ipv6host
(derefences 0x000a)
Signed-off-by: Lukasz Pawelczyk <l.pawelczyk@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/smack/smackfs.c')
-rw-r--r-- | security/smack/smackfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index c20b154a33f2..103a619b1360 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c | |||
@@ -1501,8 +1501,8 @@ static ssize_t smk_write_net6addr(struct file *file, const char __user *buf, | |||
1501 | */ | 1501 | */ |
1502 | if (smack[0] != '-') { | 1502 | if (smack[0] != '-') { |
1503 | skp = smk_import_entry(smack, 0); | 1503 | skp = smk_import_entry(smack, 0); |
1504 | if (skp == NULL) { | 1504 | if (IS_ERR(skp)) { |
1505 | rc = -EINVAL; | 1505 | rc = PTR_ERR(skp); |
1506 | goto free_out; | 1506 | goto free_out; |
1507 | } | 1507 | } |
1508 | } else { | 1508 | } else { |