Skip to content

Commit

Permalink
[PATCH] register_blkdev(): don't hand out the LOCAL/EXPERIMENTAL majors
Browse files Browse the repository at this point in the history
As pointed out in http://bugzilla.kernel.org/show_bug.cgi?id=7922, dynamic
blockdev 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 215122e commit fdf892b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ int register_blkdev(unsigned int major, const char *name)
/* temporary */
if (major == 0) {
for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) {
/*
* Disallow the LANANA-assigned LOCAL/EXPERIMENTAL
* majors
*/
if ((60 <= index && index <= 63) ||
(120 <= index && index <= 127) ||
(240 <= index && index <= 254))
continue;
if (major_names[index] == NULL)
break;
}
Expand Down

0 comments on commit fdf892b

Please sign in to comment.