1. 12 11月, 2010 1 次提交
    • E
      netfilter: NF_HOOK_COND has wrong conditional · ac5aa2e3
      Eric Paris 提交于
      The NF_HOOK_COND returns 0 when it shouldn't due to what I believe to be an
      error in the code as the order of operations is not what was intended.  C will
      evalutate == before =.  Which means ret is getting set to the bool result,
      rather than the return value of the function call.  The code says
      
      if (ret = function() == 1)
      when it meant to say:
      if ((ret = function()) == 1)
      
      Normally the compiler would warn, but it doesn't notice it because its
      a actually complex conditional and so the wrong code is wrapped in an explict
      set of () [exactly what the compiler wants you to do if this was intentional].
      Fixing this means that errors when netfilter denies a packet get propagated
      back up the stack rather than lost.
      
      Problem introduced by commit 2249065f (netfilter: get rid of the grossness
      in netfilter.h).
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      ac5aa2e3
  2. 19 2月, 2010 1 次提交
  3. 15 2月, 2010 2 次提交
  4. 02 2月, 2010 1 次提交
  5. 05 11月, 2009 1 次提交
  6. 01 10月, 2009 1 次提交
  7. 08 10月, 2008 3 次提交
  8. 22 5月, 2008 1 次提交
  9. 14 4月, 2008 2 次提交
    • P
      [NETFILTER]: Add partial checksum validation helper · d63a6507
      Patrick McHardy 提交于
      Move the UDP-Lite conntrack checksum validation to a generic helper
      similar to nf_checksum() and make it fall back to nf_checksum()
      in case the full packet is to be checksummed and hardware checksums
      are available. This is to be used by DCCP conntrack, which also
      needs to verify partial checksums.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      d63a6507
    • A
      [NETFILTER]: ip_tables: per-netns FILTER/MANGLE/RAW tables for real · 666953df
      Alexey Dobriyan 提交于
      Commit 9335f047 aka
      "[NETFILTER]: ip_tables: per-netns FILTER, MANGLE, RAW"
      added per-netns _view_ of iptables rules. They were shown to user, but
      ignored by filtering code. Now that it's possible to at least ping loopback,
      per-netns tables can affect filtering decisions.
      
      netns is taken in case of
      	PRE_ROUTING, LOCAL_IN -- from in device,
      	POST_ROUTING, LOCAL_OUT -- from out device,
      	FORWARD -- from in device which should be equal to out device's netns.
      		   This code is relatively new, so BUG_ON was plugged.
      
      Wrappers were added to a) keep code the same from CONFIG_NET_NS=n users
      (overwhelming majority), b) consolidate code in one place -- similar
      changes will be done in ipv6 and arp netfilter code.
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      666953df
  10. 26 3月, 2008 1 次提交
  11. 28 2月, 2008 1 次提交
  12. 20 2月, 2008 1 次提交
  13. 29 1月, 2008 15 次提交
  14. 16 10月, 2007 2 次提交
  15. 11 9月, 2007 1 次提交
    • N
      [NETFILTER]: Fix/improve deadlock condition on module removal netfilter · 16fcec35
      Neil Horman 提交于
      So I've had a deadlock reported to me.  I've found that the sequence of
      events goes like this:
      
      1) process A (modprobe) runs to remove ip_tables.ko
      
      2) process B (iptables-restore) runs and calls setsockopt on a netfilter socket,
      increasing the ip_tables socket_ops use count
      
      3) process A acquires a file lock on the file ip_tables.ko, calls remove_module
      in the kernel, which in turn executes the ip_tables module cleanup routine,
      which calls nf_unregister_sockopt
      
      4) nf_unregister_sockopt, seeing that the use count is non-zero, puts the
      calling process into uninterruptible sleep, expecting the process using the
      socket option code to wake it up when it exits the kernel
      
      4) the user of the socket option code (process B) in do_ipt_get_ctl, calls
      ipt_find_table_lock, which in this case calls request_module to load
      ip_tables_nat.ko
      
      5) request_module forks a copy of modprobe (process C) to load the module and
      blocks until modprobe exits.
      
      6) Process C. forked by request_module process the dependencies of
      ip_tables_nat.ko, of which ip_tables.ko is one.
      
      7) Process C attempts to lock the request module and all its dependencies, it
      blocks when it attempts to lock ip_tables.ko (which was previously locked in
      step 3)
      
      Theres not really any great permanent solution to this that I can see, but I've
      developed a two part solution that corrects the problem
      
      Part 1) Modifies the nf_sockopt registration code so that, instead of using a
      use counter internal to the nf_sockopt_ops structure, we instead use a pointer
      to the registering modules owner to do module reference counting when nf_sockopt
      calls a modules set/get routine.  This prevents the deadlock by preventing set 4
      from happening.
      
      Part 2) Enhances the modprobe utilty so that by default it preforms non-blocking
      remove operations (the same way rmmod does), and add an option to explicity
      request blocking operation.  So if you select blocking operation in modprobe you
      can still cause the above deadlock, but only if you explicity try (and since
      root can do any old stupid thing it would like....  :)  ).
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16fcec35
  16. 11 7月, 2007 1 次提交
  17. 26 4月, 2007 2 次提交
  18. 13 2月, 2007 2 次提交
  19. 05 12月, 2006 1 次提交