Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=caff5b6a6bfd0c55b359b2b4acd8c14f828b689e
Commit:     caff5b6a6bfd0c55b359b2b4acd8c14f828b689e
Parent:     1fd2a25b77bb6755d38aca50b826ff8dca81d762
Author:     Paul Moore <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 15 16:49:28 2006 -0500
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Fri Dec 22 11:11:58 2006 -0800

    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 <[EMAIL PROTECTED]>
    Signed-off-by: James Morris <[EMAIL PROTECTED]>
---
 net/netlabel/netlabel_cipso_v4.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 1fbc906..4afc75f 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)
        struct nlattr *nla_b;
        int nla_a_rem;
        int nla_b_rem;
+       u32 iter;
 
        if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] ||
            !info->attrs[NLBL_CIPSOV4_A_MLSLVLLST])
@@ -231,6 +232,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info)
                ret_val = -ENOMEM;
                goto add_std_failure;
        }
+       for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++)
+               doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL;
+       for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++)
+               doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL;
        nla_for_each_nested(nla_a,
                            info->attrs[NLBL_CIPSOV4_A_MLSLVLLST],
                            nla_a_rem)
@@ -302,6 +307,10 @@ static int netlbl_cipsov4_add_std(struct genl_info *info)
                        ret_val = -ENOMEM;
                        goto add_std_failure;
                }
+               for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++)
+                       doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT;
+               for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++)
+                       doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT;
                nla_for_each_nested(nla_a,
                                    info->attrs[NLBL_CIPSOV4_A_MLSCATLST],
                                    nla_a_rem)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to