diff options
author | Dmytro Linkin <dmitrolin@mellanox.com> | 2019-08-01 15:02:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-05 19:59:14 +0200 |
commit | 7be8ef2cdbfe41a2e524b7c6cc3f8e6cfaa906e4 (patch) | |
tree | 42b36459934917001e8ed83595d238924120b3c9 /arch | |
parent | net: dsa: mv88e6xxx: drop adjust_link to enabled phylink (diff) | |
download | linux-7be8ef2cdbfe41a2e524b7c6cc3f8e6cfaa906e4.tar.xz linux-7be8ef2cdbfe41a2e524b7c6cc3f8e6cfaa906e4.zip |
net: sched: use temporary variable for actions indexes
Currently init call of all actions (except ipt) init their 'parm'
structure as a direct pointer to nla data in skb. This leads to race
condition when some of the filter actions were initialized successfully
(and were assigned with idr action index that was written directly
into nla data), but then were deleted and retried (due to following
action module missing or classifier-initiated retry), in which case
action init code tries to insert action to idr with index that was
assigned on previous iteration. During retry the index can be reused
by another action that was inserted concurrently, which causes
unintended action sharing between filters.
To fix described race condition, save action idr index to temporary
stack-allocated variable instead on nla data.
Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions