1. 14 4月, 2008 2 次提交
  2. 26 3月, 2008 1 次提交
  3. 06 3月, 2008 1 次提交
  4. 01 2月, 2008 8 次提交
    • A
    • P
      [NETFILTER]: {ip,arp,ip6}_tables: fix sparse warnings in compat code · b0a6363c
      Patrick McHardy 提交于
        CHECK   net/ipv4/netfilter/ip_tables.c
      net/ipv4/netfilter/ip_tables.c:1453:8: warning: incorrect type in argument 3 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1453:8:    expected int *size
      net/ipv4/netfilter/ip_tables.c:1453:8:    got unsigned int [usertype] *size
      net/ipv4/netfilter/ip_tables.c:1458:44: warning: incorrect type in argument 3 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1458:44:    expected int *size
      net/ipv4/netfilter/ip_tables.c:1458:44:    got unsigned int [usertype] *size
      net/ipv4/netfilter/ip_tables.c:1603:2: warning: incorrect type in argument 2 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1603:2:    expected unsigned int *i
      net/ipv4/netfilter/ip_tables.c:1603:2:    got int *<noident>
      net/ipv4/netfilter/ip_tables.c:1627:8: warning: incorrect type in argument 3 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1627:8:    expected int *size
      net/ipv4/netfilter/ip_tables.c:1627:8:    got unsigned int *size
      net/ipv4/netfilter/ip_tables.c:1634:40: warning: incorrect type in argument 3 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1634:40:    expected int *size
      net/ipv4/netfilter/ip_tables.c:1634:40:    got unsigned int *size
      net/ipv4/netfilter/ip_tables.c:1653:8: warning: incorrect type in argument 5 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1653:8:    expected unsigned int *i
      net/ipv4/netfilter/ip_tables.c:1653:8:    got int *<noident>
      net/ipv4/netfilter/ip_tables.c:1666:2: warning: incorrect type in argument 2 (different signedness)
      net/ipv4/netfilter/ip_tables.c:1666:2:    expected unsigned int *i
      net/ipv4/netfilter/ip_tables.c:1666:2:    got int *<noident>
        CHECK   net/ipv4/netfilter/arp_tables.c
      net/ipv4/netfilter/arp_tables.c:1285:40: warning: incorrect type in argument 3 (different signedness)
      net/ipv4/netfilter/arp_tables.c:1285:40:    expected int *size
      net/ipv4/netfilter/arp_tables.c:1285:40:    got unsigned int *size
      net/ipv4/netfilter/arp_tables.c:1543:44: warning: incorrect type in argument 3 (different signedness)
      net/ipv4/netfilter/arp_tables.c:1543:44:    expected int *size
      net/ipv4/netfilter/arp_tables.c:1543:44:    got unsigned int [usertype] *size
        CHECK   net/ipv6/netfilter/ip6_tables.c
      net/ipv6/netfilter/ip6_tables.c:1481:8: warning: incorrect type in argument 3 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1481:8:    expected int *size
      net/ipv6/netfilter/ip6_tables.c:1481:8:    got unsigned int [usertype] *size
      net/ipv6/netfilter/ip6_tables.c:1486:44: warning: incorrect type in argument 3 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1486:44:    expected int *size
      net/ipv6/netfilter/ip6_tables.c:1486:44:    got unsigned int [usertype] *size
      net/ipv6/netfilter/ip6_tables.c:1631:2: warning: incorrect type in argument 2 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1631:2:    expected unsigned int *i
      net/ipv6/netfilter/ip6_tables.c:1631:2:    got int *<noident>
      net/ipv6/netfilter/ip6_tables.c:1655:8: warning: incorrect type in argument 3 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1655:8:    expected int *size
      net/ipv6/netfilter/ip6_tables.c:1655:8:    got unsigned int *size
      net/ipv6/netfilter/ip6_tables.c:1662:40: warning: incorrect type in argument 3 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1662:40:    expected int *size
      net/ipv6/netfilter/ip6_tables.c:1662:40:    got unsigned int *size
      net/ipv6/netfilter/ip6_tables.c:1680:8: warning: incorrect type in argument 5 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1680:8:    expected unsigned int *i
      net/ipv6/netfilter/ip6_tables.c:1680:8:    got int *<noident>
      net/ipv6/netfilter/ip6_tables.c:1693:2: warning: incorrect type in argument 2 (different signedness)
      net/ipv6/netfilter/ip6_tables.c:1693:2:    expected unsigned int *i
      net/ipv6/netfilter/ip6_tables.c:1693:2:    got int *<noident>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0a6363c
    • A
      [NETFILTER]: netns: put table module on netns stop · df200969
      Alexey Dobriyan 提交于
      When number of entries exceeds number of initial entries, foo-tables code
      will pin table module. But during table unregister on netns stop,
      that additional pin was forgotten.
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df200969
    • A
      [NETFILTER]: ip6_tables: netns preparation · 336b517f
      Alexey Dobriyan 提交于
      * Propagate netns from userspace down to xt_find_table_lock()
      * Register ip6 tables in netns (modules still use init_net)
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      336b517f
    • A
      [NETFILTER]: x_tables: return new table from {arp,ip,ip6}t_register_table() · 44d34e72
      Alexey Dobriyan 提交于
      Typical table module registers xt_table structure (i.e. packet_filter)
      and link it to list during it. We can't use one template for it because
      corresponding list_head will become corrupted. We also can't unregister
      with template because it wasn't changed at all and thus doesn't know in
      which list it is.
      
      So, we duplicate template at the very first step of table registration.
      Table modules will save it for use during unregistration time and actual
      filtering.
      
      Do it at once to not screw bisection.
      
      P.S.: renaming i.e. packet_filter => __packet_filter is temporary until
            full netnsization of table modules is done.
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44d34e72
    • A
      [NETFILTER]: x_tables: per-netns xt_tables · 8d870052
      Alexey Dobriyan 提交于
      In fact all we want is per-netns set of rules, however doing that will
      unnecessary complicate routines such as ipt_hook()/ipt_do_table, so
      make full xt_table array per-netns.
      
      Every user stubbed with init_net for a while.
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d870052
    • A
      [NETFILTER]: x_tables: change xt_table_register() return value convention · a98da11d
      Alexey Dobriyan 提交于
      Switch from 0/-E to ptr/PTR_ERR convention.
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a98da11d
    • J
  5. 29 1月, 2008 17 次提交
  6. 16 10月, 2007 1 次提交
  7. 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
  8. 15 7月, 2007 1 次提交
  9. 11 7月, 2007 5 次提交
  10. 26 4月, 2007 3 次提交