diff options
author | Tom Herbert <tom@herbertland.com> | 2015-08-05 18:39:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-08 00:56:56 +0200 |
commit | 10e4ea75149d11883a9e04c3b32ee1d7600d481e (patch) | |
tree | 4cf760912a8c9e3447619d6cdaeeac0835e9eaae /net/wimax | |
parent | openvswitch: Make 100 percents packets sampled when sampling rate is 1. (diff) | |
download | linux-10e4ea75149d11883a9e04c3b32ee1d7600d481e.tar.xz linux-10e4ea75149d11883a9e04c3b32ee1d7600d481e.zip |
net: Fix race condition in store_rps_map
There is a race condition in store_rps_map that allows jump label
count in rps_needed to go below zero. This can happen when
concurrently attempting to set and a clear map.
Scenario:
1. rps_needed count is zero
2. New map is assigned by setting thread, but rps_needed count _not_ yet
incremented (rps_needed count still zero)
2. Map is cleared by second thread, old_map set to that just assigned
3. Second thread performs static_key_slow_dec, rps_needed count now goes
negative
Fix is to increment or decrement rps_needed under the spinlock.
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wimax')
0 files changed, 0 insertions, 0 deletions