diff options
author | Joe Stringer <joestringer@nicira.com> | 2015-10-26 04:21:48 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-28 03:32:14 +0100 |
commit | 74c16618137f1505b0a32dea3ec73a2ef6f8f842 (patch) | |
tree | a85b6a44ec0f5d8d7ae915968ee88250c323a292 /net/openvswitch/actions.c | |
parent | fib_trie: leaf_walk_rcu should not compute key if key is less than pn->key (diff) | |
download | linux-74c16618137f1505b0a32dea3ec73a2ef6f8f842.tar.xz linux-74c16618137f1505b0a32dea3ec73a2ef6f8f842.zip |
openvswitch: Fix double-free on ip_defrag() errors
If ip_defrag() returns an error other than -EINPROGRESS, then the skb is
freed. When handle_fragments() passes this back up to
do_execute_actions(), it will be freed again. Prevent this double free
by never freeing the skb in do_execute_actions() for errors returned by
ovs_ct_execute. Always free it in ovs_ct_execute() error paths instead.
Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action")
Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/actions.c')
-rw-r--r-- | net/openvswitch/actions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 0bf0f406de52..dba635d086b2 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -1109,8 +1109,8 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, nla_data(a)); /* Hide stolen IP fragments from user space. */ - if (err == -EINPROGRESS) - return 0; + if (err) + return err == -EINPROGRESS ? 0 : err; break; } |