Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdf892be authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

[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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 215122e1
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -61,6 +61,14 @@ int register_blkdev(unsigned int major, const char *name)
	/* temporary */
	/* temporary */
	if (major == 0) {
	if (major == 0) {
		for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) {
		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)
			if (major_names[index] == NULL)
				break;
				break;
		}
		}