public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: Stephen Hemminger <shemminger@osdl.org>,
	linus@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] protect against buggy drivers
Date: Fri, 8 Oct 2004 10:50:58 -0700	[thread overview]
Message-ID: <20041008175058.GA2232@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0410081322110.4031@chaos.analogic.com>

On Fri, Oct 08, 2004 at 01:29:40PM -0400, Richard B. Johnson wrote:
> On Fri, 8 Oct 2004, Greg KH wrote:
> 
> >On Fri, Oct 08, 2004 at 09:53:41AM -0700, Stephen Hemminger wrote:
> >>+	    strlen(name) >= KOBJ_NAME_LEN ||
> >
> >There's no need for this check, if we fix the other usage of
> >cdev->kobj.name in this file to use the proper kobject_name() and
> >kobject_set_name() functions.
> 
> Well the module name is passed in register/unregister_chrdev(). It
> was not documented as the allowed length of the name so it was
> possible to install a device and then only "partially" uninstall
> the device so a subsequent open of the device-file would crash
> the kernel.  A device name of :
> 
> 	"Octrangle Contrabulator"  23 characters
> 
> ... in a test program was sufficiently-long to kill the kernel.
> I recommend truncating any name to an acceptable length. This
> would show up in /proc/iomem, etc., prompting the developer
> to shorten the name.
> 
> Also, the new length of 20 characters is probably too short.
> There was no such limitation on 2.4.x, where many modules
> are being ported from.

That's why I said this check should not go in, and the cdev code fixed
to use the proper functions.  That would enable you to have as long as a
name as you wanted to.

thanks,

greg k-h

  reply	other threads:[~2004-10-08 18:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 16:53 [PATCH] protect against buggy drivers Stephen Hemminger
2004-10-08 16:21 ` Alan Cox
2004-10-08 17:14 ` Greg KH
2004-10-08 17:29   ` Richard B. Johnson
2004-10-08 17:50     ` Greg KH [this message]
2004-10-08 18:31       ` Richard B. Johnson
2004-10-08 18:35         ` Greg KH
2004-10-08 19:32       ` Richard B. Johnson
2004-10-08 18:27   ` Stephen Hemminger
2004-10-08 18:36     ` Greg KH
2004-10-22 20:58     ` Greg KH

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=20041008175058.GA2232@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=linus@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.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