public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: davem@davemloft•net, netdev@vger•kernel.org,
	Tom Herbert <therbert@google•com>
Subject: Re: [PATCH net] sit: fix panic with route cache in ip tunnels
Date: Wed, 19 Feb 2014 17:50:06 +0100	[thread overview]
Message-ID: <5304E0BE.3020900@6wind.com> (raw)
In-Reply-To: <1392828209.18849.4.camel@edumazet-glaptop2.roam.corp.google.com>

Le 19/02/2014 17:43, Eric Dumazet a écrit :
> On Wed, 2014-02-19 at 17:15 +0100, Nicolas Dichtel wrote:
>> Bug introduced by commit 7d442fab0a67 ("ipv4: Cache dst in tunnels").
>>
>> Because sit code does not call ip_tunnel_init(), the dst_cache was not
>> initialized.
>>
>> CC: Tom Herbert <therbert@google•com>
>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind•com>
>> ---
>>   net/ipv6/sit.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
>> index 3dfbcf1dcb1c..5ff33d9bd5de 100644
>> --- a/net/ipv6/sit.c
>> +++ b/net/ipv6/sit.c
>> @@ -1326,6 +1326,9 @@ static const struct net_device_ops ipip6_netdev_ops = {
>>
>>   static void ipip6_dev_free(struct net_device *dev)
>>   {
>> +	struct ip_tunnel *tunnel = netdev_priv(dev);
>> +
>> +	free_percpu(tunnel->dst_cache);
>>   	free_percpu(dev->tstats);
>>   	free_netdev(dev);
>>   }
>> @@ -1375,6 +1378,12 @@ static int ipip6_tunnel_init(struct net_device *dev)
>>   		u64_stats_init(&ipip6_tunnel_stats->syncp);
>>   	}
>>
>> +	tunnel->dst_cache = alloc_percpu(struct ip_tunnel_dst);
>> +	if (!tunnel->dst_cache) {
>> +		free_percpu(dev->tstats);
>> +		return -ENOMEM;
>> +	}
>> +
>>   	return 0;
>>   }
>>
>
> I do not think this patch is complete.
>
> It seems to lack a tunnel_dst_reset_all() or something to properly
> release the dst.

Yes, it's why I ask David to drop it ;-)

  reply	other threads:[~2014-02-19 16:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 16:15 [PATCH net] sit: fix panic with route cache in ip tunnels Nicolas Dichtel
2014-02-19 16:22 ` Nicolas Dichtel
2014-02-20  9:19   ` [PATCH net v2] " Nicolas Dichtel
2014-02-20 18:14     ` David Miller
2014-02-19 16:43 ` [PATCH net] " Eric Dumazet
2014-02-19 16:50   ` Nicolas Dichtel [this message]
2014-02-19 17:10     ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5304E0BE.3020900@6wind.com \
    --to=nicolas.dichtel@6wind$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=therbert@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox