diff options
| author | Davide Caratti <[email protected]> | 2019-02-22 11:33:25 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2019-02-25 01:28:55 +0000 |
| commit | 8f67c90ee9148eab3d2b4393c3cf76489b27f87c (patch) | |
| tree | e9d41ec3a771e961bdcd5c073f3038f7d6eabcba /drivers/net/xen-netback/interface.c | |
| parent | Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff) | |
| download | kernel-8f67c90ee9148eab3d2b4393c3cf76489b27f87c.tar.gz kernel-8f67c90ee9148eab3d2b4393c3cf76489b27f87c.zip | |
net/sched: act_ipt: fix refcount leak when replace fails
After commit 4e8ddd7f1758 ("net: sched: don't release reference on action
overwrite"), the error path of all actions was converted to drop refcount
also when the action was being overwritten. But we forgot act_ipt_init(),
in case allocation of 'tname' was not successful:
# tc action add action xt -j LOG --log-prefix hello index 100
tablename: mangle hook: NF_IP_POST_ROUTING
target: LOG level warning prefix "hello" index 100
# tc action show action xt
total acts 1
action order 0: tablename: mangle hook: NF_IP_POST_ROUTING
target LOG level warning prefix "hello"
index 100 ref 1 bind 0
# tc action replace action xt -j LOG --log-prefix world index 100
tablename: mangle hook: NF_IP_POST_ROUTING
target: LOG level warning prefix "world" index 100
RTNETLINK answers: Cannot allocate memory
We have an error talking to the kernel
# tc action show action xt
total acts 1
action order 0: tablename: mangle hook: NF_IP_POST_ROUTING
target LOG level warning prefix "hello"
index 100 ref 2 bind 0
Ensure we call tcf_idr_release(), in case 'tname' allocation failed, also
when the action is being replaced.
Fixes: 4e8ddd7f1758 ("net: sched: don't release reference on action overwrite")
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
