[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080719233324.49392616@extreme>
Date: Sat, 19 Jul 2008 23:33:24 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: Stephen Hemminger <shemminger@...tta.com>
Cc: 吉藤英明 <yoshfuji@...ux-ipv6.org>,
David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [BUG?] dst reference leak possible in ndisc_send
On Sat, 19 Jul 2008 23:31:40 -0700
Stephen Hemminger <shemminger@...tta.com> wrote:
> This code path looks like it leaks the dst_entry if xfrm_lookup fails:
>
> static void __ndisc_send(struct net_device *dev,
> struct neighbour *neigh,
> const struct in6_addr *daddr,
> const struct in6_addr *saddr,
> struct icmp6hdr *icmp6h, const struct in6_addr *target,
> int llinfo)
> {
> struct flowi fl;
> struct dst_entry *dst;
> struct net *net = dev_net(dev);
> struct sock *sk = net->ipv6.ndisc_sk;
> struct sk_buff *skb;
> struct icmp6hdr *hdr;
> struct inet6_dev *idev;
> int len;
> int err;
> u8 *opt, type;
>
> type = icmp6h->icmp6_type;
>
> icmpv6_flow_init(sk, &fl, type, saddr, daddr, dev->ifindex);
>
> dst = icmp6_dst_alloc(dev, neigh, daddr);
> if (!dst)
> return;
>
> err = xfrm_lookup(&dst, &fl, NULL, 0);
> if (err < 0)
> return;
Never mind xfrm_lookup frees dst on error
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists