summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2007-02-12 08:51:44 (GMT)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 17:48:27 (GMT)
commitfdf892be32d84a1745fa0aee5fc60517421b8038 (patch)
tree35adb4e95219273ed681e0fa332a86b15cde731e
parent215122e1110f97a3f478829049b9840cf8fdde57 (diff)
downloadlinux-fsl-qoriq-fdf892be32d84a1745fa0aee5fc60517421b8038.tar.xz
[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 457fdac..36bd3e1 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;
}