aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel
diff options
context:
space:
mode:
authorPaul Moore <paul.moore@hp.com>2006-12-15 16:49:28 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-22 14:11:58 -0500
commitcaff5b6a6bfd0c55b359b2b4acd8c14f828b689e (patch)
treecbff31b7189e179429b5d0ef7c51e9e4d9e59930 /net/netlabel
parent1fd2a25b77bb6755d38aca50b826ff8dca81d762 (diff)
NetLabel: correctly fill in unused CIPSOv4 level and category mappings
Back when the original NetLabel patches were being changed to use Netlink attributes correctly some code was accidentially dropped which set all of the undefined CIPSOv4 level and category mappings to a sentinel value. The result is the mappings data in the kernel contains bogus mappings which always map to zero. This patch restores the old/correct behavior by initializing the mapping data to the correct sentinel value. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'net/netlabel')
-rw-r--r--net/netlabel/netlabel_cipso_v4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 1fbc906a9737..4afc75f9e377 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -162,6 +162,7 @@ static int netlbl_cipsov4_add_std(struct genl_info *info)
162 struct nlattr *nla_b; 162 struct nlattr *nla_b;
163 int nla_a_rem; 163 int nla_a_rem;
164 int nla_b_rem; 164 int nla_b_rem;
165 u32 iter;
165 166
166 if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] || 167 if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] ||
167 !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST]) 168 !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST])
@@ -231,6 +232,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info)
231 ret_val = -ENOMEM; 232 ret_val = -ENOMEM;
232 goto add_std_failure; 233 goto add_std_failure;
233 } 234 }
235 for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++)
236 doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL;
237 for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++)
238 doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL;
234 nla_for_each_nested(nla_a, 239 nla_for_each_nested(nla_a,
235 info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], 240 info->attrs[NLBL_CIPSOV4_A_MLSLVLLST],
236 nla_a_rem) 241 nla_a_rem)
@@ -302,6 +307,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info)
302 ret_val = -ENOMEM; 307 ret_val = -ENOMEM;
303 goto add_std_failure; 308 goto add_std_failure;
304 } 309 }
310 for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++)
311 doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT;
312 for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++)
313 doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT;
305 nla_for_each_nested(nla_a, 314 nla_for_each_nested(nla_a,
306 info->attrs[NLBL_CIPSOV4_A_MLSCATLST], 315 info->attrs[NLBL_CIPSOV4_A_MLSCATLST],
307 nla_a_rem) 316 nla_a_rem)