aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2007-02-12 00:51:44 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:27 -0800
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 457fdac4c17..36bd3e12a6d 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -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;
}