[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210726035702.11964-1-yajun.deng@linux.dev>
Date: Mon, 26 Jul 2021 11:57:02 +0800
From: Yajun Deng <yajun.deng@...ux.dev>
To: pablo@...filter.org, kadlec@...filter.org, fw@...len.de,
roopa@...dia.com, nikolay@...dia.com, davem@...emloft.net,
kuba@...nel.org
Cc: netfilter-devel@...r.kernel.org, coreteam@...filter.org,
bridge@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Yajun Deng <yajun.deng@...ux.dev>
Subject: [PATCH] netfilter: nf_conntrack_bridge: Fix not free when error
It should be added kfree_skb_list() when err is not equal to zero
in nf_br_ip_fragment().
Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system")
Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
---
net/bridge/netfilter/nf_conntrack_bridge.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index 8d033a75a766..059f53903eda 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -83,12 +83,16 @@ static int nf_br_ip_fragment(struct net *net, struct sock *sk,
skb->tstamp = tstamp;
err = output(net, sk, data, skb);
- if (err || !iter.frag)
- break;
-
+ if (err) {
+ kfree_skb_list(iter.frag);
+ return err;
+ }
+
+ if (!iter.frag)
+ return 0;
+
skb = ip_fraglist_next(&iter);
}
- return err;
}
slow_path:
/* This is a linearized skbuff, the original geometry is lost for us.
--
2.32.0
Powered by blists - more mailing lists