1. 04 4月, 2011 1 次提交
    • E
      netfilter: get rid of atomic ops in fast path · 7f5c6d4f
      Eric Dumazet 提交于
      We currently use a percpu spinlock to 'protect' rule bytes/packets
      counters, after various attempts to use RCU instead.
      
      Lately we added a seqlock so that get_counters() can run without
      blocking BH or 'writers'. But we really only need the seqcount in it.
      
      Spinlock itself is only locked by the current/owner cpu, so we can
      remove it completely.
      
      This cleanups api, using correct 'writer' vs 'reader' semantic.
      
      At replace time, the get_counters() call makes sure all cpus are done
      using the old table.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Jan Engelhardt <jengelh@medozas.de>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      7f5c6d4f
  2. 20 3月, 2011 1 次提交
    • E
      netfilter: xtables: fix reentrancy · db856674
      Eric Dumazet 提交于
      commit f3c5c1bf (make ip_tables reentrant) introduced a race in
      handling the stackptr restore, at the end of ipt_do_table()
      
      We should do it before the call to xt_info_rdunlock_bh(), or we allow
      cpu preemption and another cpu overwrites stackptr of original one.
      
      A second fix is to change the underflow test to check the origptr value
      instead of 0 to detect underflow, or else we allow a jump from different
      hooks.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Jan Engelhardt <jengelh@medozas.de>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      db856674
  3. 15 3月, 2011 1 次提交
    • V
      netfilter: ip_tables: fix infoleak to userspace · 78b79876
      Vasiliy Kulikov 提交于
      Structures ipt_replace, compat_ipt_replace, and xt_get_revision are
      copied from userspace.  Fields of these structs that are
      zero-terminated strings are not checked.  When they are used as argument
      to a format string containing "%s" in request_module(), some sensitive
      information is leaked to userspace via argument of spawned modprobe
      process.
      
      The first and the third bugs were introduced before the git epoch; the
      second was introduced in 2722971c (v2.6.17-rc1).  To trigger the bug
      one should have CAP_NET_ADMIN.
      Signed-off-by: NVasiliy Kulikov <segoon@openwall.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      78b79876
  4. 13 1月, 2011 1 次提交
    • E
      netfilter: x_table: speedup compat operations · 255d0dc3
      Eric Dumazet 提交于
      One iptables invocation with 135000 rules takes 35 seconds of cpu time
      on a recent server, using a 32bit distro and a 64bit kernel.
      
      We eventually trigger NMI/RCU watchdog.
      
      INFO: rcu_sched_state detected stall on CPU 3 (t=6000 jiffies)
      
      COMPAT mode has quadratic behavior and consume 16 bytes of memory per
      rule.
      
      Switch the xt_compat algos to use an array instead of list, and use a
      binary search to locate an offset in the sorted array.
      
      This halves memory need (8 bytes per rule), and removes quadratic
      behavior [ O(N*N) -> O(N*log2(N)) ]
      
      Time of iptables goes from 35 s to 150 ms.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      255d0dc3
  5. 11 1月, 2011 1 次提交
  6. 03 11月, 2010 1 次提交
  7. 14 10月, 2010 3 次提交
  8. 24 8月, 2010 1 次提交
  9. 18 8月, 2010 1 次提交
  10. 02 8月, 2010 1 次提交
  11. 23 7月, 2010 1 次提交
  12. 04 6月, 2010 1 次提交
  13. 31 5月, 2010 1 次提交
  14. 13 5月, 2010 2 次提交
  15. 12 5月, 2010 5 次提交
  16. 02 5月, 2010 2 次提交
  17. 22 4月, 2010 1 次提交
  18. 19 4月, 2010 2 次提交
  19. 25 3月, 2010 5 次提交
  20. 27 2月, 2010 1 次提交
  21. 25 2月, 2010 5 次提交
  22. 15 2月, 2010 2 次提交