netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Stephen Hemminger <shemminger@osdl.org>,
	"David S. Miller" <davem@redhat.com>,
	netdev@oss.sgi.com
Subject: Re: [PATCH] support for large number of network devices.
Date: Wed, 14 Jan 2004 13:39:08 -0800	[thread overview]
Message-ID: <20040114213908.GA22653@bougret.hpl.hp.com> (raw)

Stephen Hemminger wrote :
> 
> When using pseudo network devices, and really big machines; there is
> sometimes a need to have a lot of network devices.  This replaces the
> existing 2.6.1 limit of 100 entries an was O(n^2)
> with a algorithm that will handle up to 32768 entries with O(n) behaviour.

	You may want to be careful about buffer overflow in
dev->name. The old code did not check for it, because it was replacing
'%d' with a most 2 char ('0' to '99').
	The new code may create overflow for device names such as :
		'reallylongname%d'
	And you don't seem the catch that (unless I overlooked something).

	The problem is more messy that it looks like, because there is
no sane way to handle overflow. You can return an error to the driver,
and the driver may bail out properly (or crash), but the end user has
no way to overcome the issue and get its card loaded (short of editing
the driver and recompiling the kernel).
	So, there is a bit of auding to do first. I know for example
the HostAP create such long names.
	But that's only my humble opinion ;-)

	Jean

             reply	other threads:[~2004-01-14 21:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 21:39 Jean Tourrilhes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-13 23:46 [PATCH] support for large number of network devices Stephen Hemminger
2004-01-13 23:59 ` David S. Miller
2004-01-14  0:13   ` Stephen Hemminger
2004-01-14  7:13     ` Matt Mackall
2004-01-14 19:37       ` Stephen Hemminger
2004-01-14 19:51         ` Matt Mackall
2004-01-14 20:11         ` David S. Miller
2004-01-15  0:24           ` Stephen Hemminger
2004-01-15  8:46             ` David S. Miller
2004-01-15 17:52               ` Stephen Hemminger
2004-01-15 19:40                 ` David S. Miller
2004-01-14  0:23 ` Ben Greear
2004-01-14  0:38   ` Stephen Hemminger
2004-01-14  1:55     ` Ben Greear
2004-01-14  7:18       ` David S. Miller
2004-01-14  7:54         ` Ben Greear

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=20040114213908.GA22653@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=davem@redhat.com \
    --cc=jt@hpl.hp.com \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.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).