aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2016-05-16 15:11:18 -0700
committerDavid S. Miller <davem@davemloft.net>2016-05-17 12:40:28 -0400
commitdc327f8931cb9d66191f489eb9a852fc04530546 (patch)
treea0e7e610804776442e54467728bbb5adb95f7818 /net/switchdev
parenttipc: fix nametable publication field in nl compat (diff)
downloadlinux-dc327f8931cb9d66191f489eb9a852fc04530546.tar.gz
linux-dc327f8931cb9d66191f489eb9a852fc04530546.zip
net_sched: close another race condition in tcf_mirred_release()
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: 2ee22a90c7af ("net_sched: act_mirred: remove spinlock in fast path") Fixes: 6bd00b850635 ("act_mirred: fix a race condition on mirred_list") Cc: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
0 files changed, 0 insertions, 0 deletions
follow=1'>ARM: dmabounce: check pointer against NULL not 0Russell King1-1/+1 2011-07-03ARM: dmabounce: remove useless pr_errRussell King1-4/+1 2011-07-03ARM: dmabounce: move decision for bouncing into __dma_map_page()Russell King1-66/+58 2011-07-03ARM: dmabounce: separate out decision to bounceRussell King1-18/+28 2011-07-03ARM: dmabounce: avoid needless valid_dma_direction() checkRussell King1-2/+0 2011-07-03ARM: dma-mapping: define dma_(un)?map_single in terms of dma_(un)?map_pageRussell King2-50/+9 2011-07-03ARM: dmabounce: fix map_single() error return valueRussell King1-1/+1 2011-06-30drm/radeon/kms: increase rom size for atrm methodAlex Deucher1-1/+1 2011-06-30crypto: caam - fix operator precedence in shared descriptor allocationKim Phillips1-3/+3 2011-06-29ahci: change 'masking port_map' printk to KERN_WARNING levelLinus Torvalds1-1/+1 2011-06-29i2c/pca954x: Initialize the mux to disconnected statePetri Gynther1-3/+4 2011-06-29i2c-taos-evm: Fix log messagesJean Delvare1-4/+4 2011-06-29KVM: x86 emulator: fix %rip-relative addressing with immediate source operandAvi Kivity1-5/+7 2011-06-29arch/powerpc: use printk_ratelimited instead of printk_ratelimitChristian Dietrich5-57/+60 2011-06-29powerpc/rtas-rtc: remove sideeffects of printk_ratelimitChristian Dietrich1-12/+17 2011-06-29powerpc/pseries: remove duplicate SCSI_BNX2_ISCSI in pseries_defconfigMichael Neuling1-1/+0 2011-06-28drm/i915: Use chipset-specific irq installersChris Wilson1-2/+2 2011-06-28drm/i915: forcewake fix after resetBen Widawsky1-0/+3 2011-06-28proc: restrict access to /proc/PID/ioVasiliy Kulikov1-2/+5 2011-06-28md: avoid endless recovery loop when waiting for fail device to complete.NeilBrown1-0/+1 2011-06-27Linux 3.0-rc5v3.0-rc5Linus Torvalds1-1/+1 2011-06-27drm/i915: more struct_mutex lockingHugh Dickins2-2/+6 2011-06-27drm/i915: use shmem_truncate_rangeHugh Dickins1-5/+2 2011-06-27drm/i915: use shmem_read_mapping_pageHugh Dickins2-17/+15 2011-06-27drm/ttm: use shmem_read_mapping_pageHugh Dickins1-2/+3 2011-06-27drivers/tty/serial/8250_pci.c: fix warningAndrew Morton1-1/+1 2011-06-27drivers/misc/ioc4.c: fix section mismatch / race conditionRalf Baechle1-1/+1 2011-06-27drivers/leds/leds-lp5523.c: fix section mismatchesRalf Baechle1-2/+2 2011-06-27drivers/leds/leds-lp5521.c: fix section mismatchesRalf Baechle1-2/+2 2011-06-27memcg: fix direct softlimit reclaim to be called in limit pathKAMEZAWA Hiroyuki1-12/+15 2011-06-27taskstats: don't allow duplicate entries in listener modeVasiliy Kulikov1-3/+12 2011-06-27mm: fix assertion mapping->nrpages == 0 in end_writeback()Jan Kara3-0/+13 2011-06-27mm/memory-failure.c: fix spinlock vs mutex orderPeter Zijlstra2-18/+8 2011-06-27drivers/misc/lkdtm.c: fix race when crashpoint is hit multiple times before c...Josh Hunt1-0/+8 2011-06-27include/linux/compat.h: declare compat_sys_sendmmsg()Chris Metcalf1-0/+2 2011-06-27romfs: fix romfs_get_unmapped_area() argument checkBob Liu1-2/+6