summaryrefslogtreecommitdiff
path: root/net/bridge/netfilter
diff options
context:
space:
mode:
authorYajun Deng <yajun.deng@linux.dev>2021-07-29 11:20:21 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2021-08-04 11:41:29 +0300
commit38ea9def5b62f9193f6bad96c5d108e2830ecbde (patch)
treeee4157c66c09003b67717a518afdc0042358e73c /net/bridge/netfilter
parent5f7b51bf09baca8e4f80cbe879536842bafb5f31 (diff)
downloadlinux-38ea9def5b62f9193f6bad96c5d108e2830ecbde.tar.xz
netfilter: nf_conntrack_bridge: Fix memory leak when error
It should be added kfree_skb_list() when err is not equal to zero in nf_br_ip_fragment(). v2: keep this aligned with IPv6. v3: modify iter.frag_list to iter.frag. Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system") Signed-off-by: Yajun Deng <yajun.deng@linux.dev> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge/netfilter')
-rw-r--r--net/bridge/netfilter/nf_conntrack_bridge.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index 8d033a75a766..fdbed3158555 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -88,6 +88,12 @@ static int nf_br_ip_fragment(struct net *net, struct sock *sk,
skb = ip_fraglist_next(&iter);
}
+
+ if (!err)
+ return 0;
+
+ kfree_skb_list(iter.frag);
+
return err;
}
slow_path: