aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2007-02-12 03:51:44 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:27 -0500
commitfdf892be32d84a1745fa0aee5fc60517421b8038 (patch)
tree35adb4e95219273ed681e0fa332a86b15cde731e
parent215122e1110f97a3f478829049b9840cf8fdde57 (diff)
[PATCH] register_blkdev(): don't hand out the LOCAL/EXPERIMENTAL majors
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 <device@lanana.org> Cc: Greg KH <greg@kroah.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Tomas Klas <tomas.klas@mepatek.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--block/genhd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 457fdac4c17d..36bd3e12a6d4 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -61,6 +61,14 @@ int register_blkdev(unsigned int major, const char *name)
61 /* temporary */ 61 /* temporary */
62 if (major == 0) { 62 if (major == 0) {
63 for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) { 63 for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) {
64 /*
65 * Disallow the LANANA-assigned LOCAL/EXPERIMENTAL
66 * majors
67 */
68 if ((60 <= index && index <= 63) ||
69 (120 <= index && index <= 127) ||
70 (240 <= index && index <= 254))
71 continue;
64 if (major_names[index] == NULL) 72 if (major_names[index] == NULL)
65 break; 73 break;
66 } 74 }