[lkml]   [2004]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] protect against buggy drivers
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-> in this file to use the proper kobject_name() and
> kobject_set_name() functions.
> thanks,
> greg k-h

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.

Dick Johnson
Penguin : Linux version 2.6.8 on an i686 machine (5537.79 BogoMips).
Note 96.31% of all statistics are fiction.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:06    [W:0.081 / U:0.300 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site