[53/91] bridge: Fix skb leak when multicast parsing fails on TX

From: Greg KH
Date: Tue Aug 24 2010 - 19:31:27 EST


2.6.34-stable review patch. If anyone has any objections, please let us know.

------------------


From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

[ Upstream commit 6d1d1d398cb7db7a12c5d652d50f85355345234f ]

On the bridge TX path we're leaking an skb when br_multicast_rcv
returns an error.

Reported-by: David Lamparter <equinox@xxxxxxxxxx>
Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
net/bridge/br_device.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -37,8 +37,10 @@ netdev_tx_t br_dev_xmit(struct sk_buff *

rcu_read_lock();
if (dest[0] & 1) {
- if (br_multicast_rcv(br, NULL, skb))
+ if (br_multicast_rcv(br, NULL, skb)) {
+ kfree_skb(skb);
goto out;
+ }

mdst = br_mdb_get(br, skb);
if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/