* [PATCH net] ipv4: fix reply_dst leakage on arp reply
@ 2015-10-01 14:25 Jiri Benc
2015-10-05 11:05 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Benc @ 2015-10-01 14:25 UTC (permalink / raw)
To: netdev; +Cc: Hannes Frederic Sowa
There are cases when the created metadata reply is not used. Ensure the
allocated memory is freed also in such cases.
Fixes: 63d008a4e9ee ("ipv4: send arp replies to the correct tunnel")
Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
net/ipv4/arp.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index f03db8b7abee..0c9c3482e419 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -312,7 +312,7 @@ static void arp_send_dst(int type, int ptype, __be32 dest_ip,
if (!skb)
return;
- skb_dst_set(skb, dst);
+ skb_dst_set(skb, dst_clone(dst));
arp_xmit(skb);
}
@@ -384,7 +384,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
}
if (skb && !(dev->priv_flags & IFF_XMIT_DST_RELEASE))
- dst = dst_clone(skb_dst(skb));
+ dst = skb_dst(skb);
arp_send_dst(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr,
dst_hw, dev->dev_addr, NULL, dst);
}
@@ -811,7 +811,7 @@ static int arp_process(struct sock *sk, struct sk_buff *skb)
} else {
pneigh_enqueue(&arp_tbl,
in_dev->arp_parms, skb);
- return 0;
+ goto out_free_dst;
}
goto out;
}
@@ -865,6 +865,8 @@ static int arp_process(struct sock *sk, struct sk_buff *skb)
out:
consume_skb(skb);
+out_free_dst:
+ dst_release(reply_dst);
return 0;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] ipv4: fix reply_dst leakage on arp reply
2015-10-01 14:25 [PATCH net] ipv4: fix reply_dst leakage on arp reply Jiri Benc
@ 2015-10-05 11:05 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-10-05 11:05 UTC (permalink / raw)
To: jbenc; +Cc: netdev, hannes
From: Jiri Benc <jbenc@redhat.com>
Date: Thu, 1 Oct 2015 16:25:43 +0200
> There are cases when the created metadata reply is not used. Ensure the
> allocated memory is freed also in such cases.
>
> Fixes: 63d008a4e9ee ("ipv4: send arp replies to the correct tunnel")
> Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Jiri Benc <jbenc@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-05 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01 14:25 [PATCH net] ipv4: fix reply_dst leakage on arp reply Jiri Benc
2015-10-05 11:05 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).