diff options
| author | Davide Caratti <[email protected]> | 2019-02-22 11:33:26 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2019-02-25 01:31:43 +0000 |
| commit | 6191da98062d25276a3b88fb2a94dcbcfb3ea65d (patch) | |
| tree | af18b890509ab7f2d3fc3a9ab75947f51ca409f6 /drivers/net/xen-netback/interface.c | |
| parent | net/sched: act_ipt: fix refcount leak when replace fails (diff) | |
| download | kernel-6191da98062d25276a3b88fb2a94dcbcfb3ea65d.tar.gz kernel-6191da98062d25276a3b88fb2a94dcbcfb3ea65d.zip | |
net/sched: act_skbedit: fix refcount leak when replace fails
when act_skbedit was converted to use RCU in the data plane, we added an
error path, but we forgot to drop the action refcount in case of failure
during a 'replace' operation:
# tc actions add action skbedit ptype otherhost pass index 100
# tc action show action skbedit
total acts 1
action order 0: skbedit ptype otherhost pass
index 100 ref 1 bind 0
# tc actions replace action skbedit ptype otherhost drop index 100
RTNETLINK answers: Cannot allocate memory
We have an error talking to the kernel
# tc action show action skbedit
total acts 1
action order 0: skbedit ptype otherhost pass
index 100 ref 2 bind 0
Ensure we call tcf_idr_release(), in case 'params_new' allocation failed,
also when the action is being replaced.
Fixes: c749cdda9089 ("net/sched: act_skbedit: don't use spinlock in the data path")
Signed-off-by: Davide Caratti <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
0 files changed, 0 insertions, 0 deletions
