aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel/netlabel_kapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlabel/netlabel_kapi.c')
-rw-r--r--net/netlabel/netlabel_kapi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index ff971103fd0c..da2f1975a042 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -62,6 +62,9 @@ int netlbl_socket_setattr(const struct socket *sock,
62 int ret_val = -ENOENT; 62 int ret_val = -ENOENT;
63 struct netlbl_dom_map *dom_entry; 63 struct netlbl_dom_map *dom_entry;
64 64
65 if ((secattr->flags & NETLBL_SECATTR_DOMAIN) == 0)
66 return -ENOENT;
67
65 rcu_read_lock(); 68 rcu_read_lock();
66 dom_entry = netlbl_domhsh_getentry(secattr->domain); 69 dom_entry = netlbl_domhsh_getentry(secattr->domain);
67 if (dom_entry == NULL) 70 if (dom_entry == NULL)
@@ -200,7 +203,7 @@ void netlbl_cache_invalidate(void)
200int netlbl_cache_add(const struct sk_buff *skb, 203int netlbl_cache_add(const struct sk_buff *skb,
201 const struct netlbl_lsm_secattr *secattr) 204 const struct netlbl_lsm_secattr *secattr)
202{ 205{
203 if (secattr->cache == NULL) 206 if ((secattr->flags & NETLBL_SECATTR_CACHE) == 0)
204 return -ENOMSG; 207 return -ENOMSG;
205 208
206 if (CIPSO_V4_OPTEXIST(skb)) 209 if (CIPSO_V4_OPTEXIST(skb))