Ignore:
Timestamp:
2010-07-17T15:01:16+02:00 (6 years ago)
Author:
hauke
Message:

kernel: fix kernel panic when traffic goes over the network.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/patches-2.6.35/110-netfilter_match_speedup.patch

    r21952 r22246  
    7676  
    7777 /* for const-correctness */ 
    78 @@ -312,8 +338,28 @@ ipt_do_table(struct sk_buff *skb, 
     78@@ -312,8 +338,29 @@ ipt_do_table(struct sk_buff *skb, 
    7979        const struct xt_table_info *private; 
    8080        struct xt_action_param acpar; 
     
    8686+       xt_info_rdlock_bh(); 
    8787+       private = table->private; 
    88 +       table_base = private->entries[smp_processor_id()]; 
     88+       cpu        = smp_processor_id(); 
     89+       table_base = private->entries[cpu]; 
    8990+       e = get_entry(table_base, private->hook_entry[hook]); 
    9091+ 
     
    106107        outdev = out ? out->name : nulldevname; 
    107108        /* We handle fragments by dealing with the first fragment as 
    108 @@ -970,6 +1016,7 @@ copy_entries_to_user(unsigned int total_ 
     109@@ -330,17 +377,10 @@ ipt_do_table(struct sk_buff *skb, 
     110        acpar.family  = NFPROTO_IPV4; 
     111        acpar.hooknum = hook; 
     112  
     113-       IP_NF_ASSERT(table->valid_hooks & (1 << hook)); 
     114-       xt_info_rdlock_bh(); 
     115-       private = table->private; 
     116-       cpu        = smp_processor_id(); 
     117-       table_base = private->entries[cpu]; 
     118        jumpstack  = (struct ipt_entry **)private->jumpstack[cpu]; 
     119        stackptr   = per_cpu_ptr(private->stackptr, cpu); 
     120        origptr    = *stackptr; 
     121  
     122-       e = get_entry(table_base, private->hook_entry[hook]); 
     123- 
     124        pr_debug("Entering %s(hook %u); sp at %u (UF %p)\n", 
     125                 table->name, hook, origptr, 
     126                 get_entry(table_base, private->underflow[hook])); 
     127@@ -970,6 +1010,7 @@ copy_entries_to_user(unsigned int total_ 
    109128                unsigned int i; 
    110129                const struct ipt_entry_match *m; 
     
    114133                e = (struct ipt_entry *)(loc_cpu_entry + off); 
    115134                if (copy_to_user(userptr + off 
    116 @@ -979,6 +1026,14 @@ copy_entries_to_user(unsigned int total_ 
    117                         ret = -EFAULT; 
     135@@ -980,6 +1021,14 @@ copy_entries_to_user(unsigned int total_ 
    118136                        goto free_counters; 
    119137                } 
    120 + 
     138  
    121139+               flags = e->ip.flags & ~IPT_F_NO_DEF_MATCH; 
    122140+               if (copy_to_user(userptr + off 
     
    126144+                       goto free_counters; 
    127145+               } 
    128   
     146+ 
    129147                for (i = sizeof(struct ipt_entry); 
    130148                     i < e->target_offset; 
     149                     i += m->u.match_size) { 
Note: See TracChangeset for help on using the changeset viewer.