Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3482fd9099e8aab8b8096eb6da93571ea5a0b4c2
Commit:     3482fd9099e8aab8b8096eb6da93571ea5a0b4c2
Parent:     4a2a4df7b6db25df8f3d5cc6dd0b096119359d92
Author:     Paul Moore <[EMAIL PROTECTED]>
AuthorDate: Tue Aug 7 17:53:10 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Aug 7 17:53:10 2007 -0700

    [NetLabel]: add missing rcu_dereference() calls in the LSM domain mapping 
hash table
    The LSM domain mapping head table pointer was not being referenced via the 
RCU
    safe dereferencing function, rcu_dereference().  This patch adds those 
missing
    calls to the NetLabel code.
    
    This has been tested using recent linux-2.6 git kernels with no visible
    regressions.
    
    Signed-off-by: Paul Moore <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netlabel/netlabel_domainhash.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/netlabel/netlabel_domainhash.c 
b/net/netlabel/netlabel_domainhash.c
index f46a0ae..b6c844b 100644
--- a/net/netlabel/netlabel_domainhash.c
+++ b/net/netlabel/netlabel_domainhash.c
@@ -126,7 +126,9 @@ static struct netlbl_dom_map *netlbl_domhsh_search(const 
char *domain, u32 def)
 
        if (domain != NULL) {
                bkt = netlbl_domhsh_hash(domain);
-               list_for_each_entry_rcu(iter, &netlbl_domhsh->tbl[bkt], list)
+               list_for_each_entry_rcu(iter,
+                                    &rcu_dereference(netlbl_domhsh)->tbl[bkt],
+                                    list)
                        if (iter->valid && strcmp(iter->domain, domain) == 0)
                                return iter;
        }
@@ -227,7 +229,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry,
                spin_lock(&netlbl_domhsh_lock);
                if (netlbl_domhsh_search(entry->domain, 0) == NULL)
                        list_add_tail_rcu(&entry->list,
-                                         &netlbl_domhsh->tbl[bkt]);
+                                   &rcu_dereference(netlbl_domhsh)->tbl[bkt]);
                else
                        ret_val = -EEXIST;
                spin_unlock(&netlbl_domhsh_lock);
@@ -423,8 +425,8 @@ int netlbl_domhsh_walk(u32 *skip_bkt,
             iter_bkt < rcu_dereference(netlbl_domhsh)->size;
             iter_bkt++, chain_cnt = 0) {
                list_for_each_entry_rcu(iter_entry,
-                                       &netlbl_domhsh->tbl[iter_bkt],
-                                       list)
+                               &rcu_dereference(netlbl_domhsh)->tbl[iter_bkt],
+                               list)
                        if (iter_entry->valid) {
                                if (chain_cnt++ < *skip_chain)
                                        continue;
-
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