BACKPORT: Smack: fix a NULL dereference in wrong smack_import_entry() usage
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 25 Aug 2015 10:39:46 +0000 (12:39 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Mon, 21 Nov 2016 16:02:05 +0000 (17:02 +0100)
commit4b9d02d6b010995bb30b5216fc6b7c9d8dd3956e
treef2531ff6fe3f96ed26a6cf8e633283034ad701a3
parent162615e35e15cb11984a34fcba20f567b379f3c8
BACKPORT: 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>
(cherry-picked from upstream 5f2bfe2f1de8b745dc294acaf2ca2ad68e09b374)
security/smack/smackfs.c