diff options
author | Alex Wang <alexw@nicira.com> | 2014-08-21 15:54:07 -0700 |
---|---|---|
committer | Alex Wang <alexw@nicira.com> | 2014-09-03 13:29:03 -0700 |
commit | a1fdee136b278e575d84aeeac06374a44a530300 (patch) | |
tree | acba542f157ba1aabdb9b1697919994878231f84 /datapath-windows/ovsext/Netlink | |
parent | 16ee1400bbff0f001c2075f413da4bee9f9190e8 (diff) | |
download | openvswitch-a1fdee136b278e575d84aeeac06374a44a530300.tar.gz |
dpif-netdev: Introduce port_try_ref() to prevent a race.
When pmd thread interates through all ports for queue loading,
the main thread may unreference and 'rcu-free' a port before
pmd thread take new reference of it. This could cause pmd
thread fail the reference and access freed memory later.
This commit fixes this race by introducing port_try_ref()
which uses ovs_refcount_try_ref_rcu(). And the pmd thread
will only load the port's queue, if port_try_ref() returns
true.
Found by inspection.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Netlink')
0 files changed, 0 insertions, 0 deletions