From: Pavel Emelyanov <xemul@openvz.org>
To: Patrick McHardy <kaber@trash.net>
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 15:17:27 +0300 [thread overview]
Message-ID: <47BD6BD7.1060200@openvz.org> (raw)
In-Reply-To: <47BD6A28.1030007@trash.net>
Patrick McHardy wrote:
> 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.
>
Actually, I thought the same, but fixing % in names looks like a
BUG-fix for 2.6.25, while removing the hand-made name allocation
looks like an enhancement for 2.6.26. No?
Thanks,
Pavel
next prev parent reply other threads:[~2008-02-21 12:17 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
2008-02-21 12:17 ` Pavel Emelyanov [this message]
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=47BD6BD7.1060200@openvz.org \
--to=xemul@openvz.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.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 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).