All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	devel@openvz.org
Subject: Re: [PATCH] Don't create tunnels with '%' in name.
Date: Thu, 21 Feb 2008 13:10:16 +0100	[thread overview]
Message-ID: <47BD6A28.1030007@trash.net> (raw)
In-Reply-To: <47BD6907.7050303@openvz.org>

Pavel Emelyanov wrote:
> Four tunnel drivers (ip_gre, ipip, ip6_tunnel and sit) can
> receive a pre-defined name for a device from the userspace.
> Since these drivers call the register_netdevice() after this 
> (rtnl_lock is held), the device's name may contain a '%' 
> character.
> 
> Not sure how bad is this to have a device with a '%' in its
> name, but all the other places either use the register_netdev(),
> or explicitly call dev_alloc_name() before registering, i.e. 
> do not allow for such names.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> ---
> 
> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
> index 63f6917..6b9744f 100644
> --- a/net/ipv4/ip_gre.c
> +++ b/net/ipv4/ip_gre.c
> @@ -274,19 +274,24 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int
>  	if (!dev)
>  	  return NULL;
>  
> +	if (strchr(name, '%')) {
> +		if (dev_alloc_name(dev, name) < 0)
> +			goto failed_free;
> +	}
> +


It would be nicer to replace the entire hand-made name
allocation to remove the 100 device limit.

  reply	other threads:[~2008-02-21 12:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 12:05 [PATCH] Don't create tunnels with '%' in name Pavel Emelyanov
2008-02-21 12:10 ` Patrick McHardy [this message]
2008-02-21 12:17   ` Pavel Emelyanov
2008-02-21 12:22     ` Patrick McHardy
2008-02-21 12:38       ` [PATCH] Don't limit the number of tunnels with generic name explicitly Pavel Emelyanov
2008-02-21 12:45         ` Patrick McHardy
2008-02-24  4:20         ` David Miller
2008-02-26  7:47           ` Pavel Emelyanov
2008-02-26 21:31             ` David Miller

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=47BD6A28.1030007@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=devel@openvz.org \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.