Skip to content

Commit

Permalink
[PATCH] register_chrdev_region() don't hand out the LOCAL/EXPERIMENTA…
Browse files Browse the repository at this point in the history
…L majors

As pointed out in http://bugzilla.kernel.org/show_bug.cgi?id=7922, dynamic
chardev major allocation can hand out majors which LANANA has defined as being
for local/experimental use.

Cc: Torben Mathiasen <[email protected]>
Cc: Greg KH <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Tomas Klas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Feb 12, 2007
1 parent 6ab8eb1 commit 215122e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/char_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor,
/* temporary */
if (major == 0) {
for (i = ARRAY_SIZE(chrdevs)-1; i > 0; i--) {
/*
* Disallow the LANANA-assigned LOCAL/EXPERIMENTAL
* majors
*/
if ((60 <= i && i <= 63) || (120 <= i && i <= 127) ||
(240 <= i && i <= 254))
continue;
if (chrdevs[i] == NULL)
break;
}
Expand Down

0 comments on commit 215122e

Please sign in to comment.