1. 08 6月, 2016 1 次提交
  2. 18 5月, 2016 1 次提交
    • W
      net_sched: close another race condition in tcf_mirred_release() · dc327f89
      WANG Cong 提交于
      We saw the following extra refcount release on veth device:
      
        kernel: [7957821.463992] unregister_netdevice: waiting for mesos50284 to become free. Usage count = -1
      
      Since we heavily use mirred action to redirect packets to veth, I think
      this is caused by the following race condition:
      
      CPU0:
      tcf_mirred_release(): (in RCU callback)
      	struct net_device *dev = rcu_dereference_protected(m->tcfm_dev, 1);
      
      CPU1:
      mirred_device_event():
              spin_lock_bh(&mirred_list_lock);
              list_for_each_entry(m, &mirred_list, tcfm_list) {
                      if (rcu_access_pointer(m->tcfm_dev) == dev) {
                              dev_put(dev);
                              /* Note : no rcu grace period necessary, as
                               * net_device are already rcu protected.
                               */
                              RCU_INIT_POINTER(m->tcfm_dev, NULL);
                      }
              }
              spin_unlock_bh(&mirred_list_lock);
      
      CPU0:
      tcf_mirred_release():
              spin_lock_bh(&mirred_list_lock);
              list_del(&m->tcfm_list);
              spin_unlock_bh(&mirred_list_lock);
              if (dev)               // <======== Stil refers to the old m->tcfm_dev
                      dev_put(dev);  // <======== dev_put() is called on it again
      
      The action init code path is good because it is impossible to modify
      an action that is being removed.
      
      So, fix this by moving everything under the spinlock.
      
      Fixes: 2ee22a90 ("net_sched: act_mirred: remove spinlock in fast path")
      Fixes: 6bd00b85 ("act_mirred: fix a race condition on mirred_list")
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc327f89
  3. 11 5月, 2016 1 次提交
  4. 27 4月, 2016 1 次提交
  5. 02 3月, 2016 1 次提交
  6. 26 2月, 2016 1 次提交
  7. 08 10月, 2015 1 次提交
  8. 05 10月, 2015 2 次提交
  9. 04 8月, 2015 1 次提交
  10. 09 7月, 2015 2 次提交
  11. 14 5月, 2015 1 次提交
  12. 18 4月, 2015 1 次提交
  13. 07 11月, 2014 1 次提交
  14. 21 7月, 2014 1 次提交
  15. 13 2月, 2014 3 次提交
  16. 22 1月, 2014 1 次提交
  17. 20 1月, 2014 1 次提交
  18. 14 1月, 2014 1 次提交
  19. 21 12月, 2013 1 次提交
  20. 19 12月, 2013 1 次提交
  21. 06 12月, 2013 2 次提交
  22. 29 5月, 2013 1 次提交
  23. 15 1月, 2013 1 次提交
  24. 17 8月, 2012 1 次提交
    • J
      act_mirred: do not drop packets when fails to mirror it · 16c0b164
      Jason Wang 提交于
      We drop packet unconditionally when we fail to mirror it. This is not intended
      in some cases. Consdier for kvm guest, we may mirror the traffic of the bridge
      to a tap device used by a VM. When kernel fails to mirror the packet in
      conditions such as when qemu crashes or stop polling the tap, it's hard for the
      management software to detect such condition and clean the the mirroring
      before. This would lead all packets to the bridge to be dropped and break the
      netowrk of other virtual machines.
      
      To solve the issue, the patch does not drop packets when kernel fails to mirror
      it, and only drop the redirected packets.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16c0b164
  25. 16 5月, 2012 1 次提交
  26. 02 4月, 2012 1 次提交
  27. 18 8月, 2011 1 次提交
  28. 06 7月, 2011 1 次提交
  29. 20 1月, 2011 1 次提交
  30. 11 1月, 2011 1 次提交
  31. 18 8月, 2010 1 次提交
  32. 25 7月, 2010 1 次提交
  33. 01 7月, 2010 1 次提交
  34. 29 6月, 2010 1 次提交
  35. 18 5月, 2010 1 次提交