summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2013-05-27 20:11:27 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:46:04 +0900
commit7b8ae9d19bd8c31ee4e99c0e268a7019d189426b (patch)
treedf75e57dad9a6070fc71a3c17894b22d067f787b /security
parent16815b60b7d92fd8af03c319fab224a0e1460ba5 (diff)
downloadlinux-3.10-7b8ae9d19bd8c31ee4e99c0e268a7019d189426b.tar.gz
linux-3.10-7b8ae9d19bd8c31ee4e99c0e268a7019d189426b.tar.bz2
linux-3.10-7b8ae9d19bd8c31ee4e99c0e268a7019d189426b.zip
Smack: Fix possible NULL pointer dereference at smk_netlbl_mls()
netlbl_secattr_catmap_alloc(GFP_ATOMIC) can return NULL. Change-Id: Id67f7f66a61a05e7e45b66a50b5d0869ef7e5117 Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Ɓukasz Stelmach <l.stelmach@samsung.com>
Diffstat (limited to 'security')
-rw-r--r--security/smack/smack_access.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
index 53f2327a592..6a0377f3862 100644
--- a/security/smack/smack_access.c
+++ b/security/smack/smack_access.c
@@ -403,6 +403,8 @@ int smk_netlbl_mls(int level, char *catset, struct netlbl_lsm_secattr *sap,
sap->flags |= NETLBL_SECATTR_MLS_CAT;
sap->attr.mls.lvl = level;
sap->attr.mls.cat = netlbl_secattr_catmap_alloc(GFP_ATOMIC);
+ if (!sap->attr.mls.cat)
+ return -ENOMEM;
sap->attr.mls.cat->startbit = 0;
for (cat = 1, cp = catset, byte = 0; byte < len; cp++, byte++)